Quote:
Originally Posted by login_xcvop
show
|
Code:
new times[33] = {0, ...};
new killCount[33] = {0, ...};
public plugin_init()
{
register_event("DeathMsg", "PlayerKilled", "a");
register_logevent("RoundStart",2,"1=Round_Start");
}
public RoundStart()
{
for(new i=0; i<sizeof(times); i++) {
times[i] = get_systime();
killCount[i] = 0;
}
}
public PlayerKilled()
{
new killerIndx = read_data(1);
if(0 < killerIndx) {
if(0 < killCount[killerIndx]) {
new currTime = get_systime();
// Check if the kills interval is within 90 sec.
if(90 >= currTime - times[killerIndx]) {
killCount[killerIndx]++;
} else {
killCount[killerIndx] = 1;
times[killerIndx] = currTime;
}
} else {
killCount[killerIndx] = 1;
times[killerIndx] = get_systime();
}
if(3 <= killCount[killerIndx]) {
// Triple Kill within 90 sec.
}
}
}