Hello guys
How is it possible to prolong timer if something is checked
For example, I'm trying to make a plugin if you killed someone, you will have some abilities and after a period of time, it will be turning off.
After killing someone you will have like 10 seconds of these abilities then it will go back to normal.
What I want to do is, if I killed more players, the time to rest to normal will be delayed, like killing 3 players simultaneously will give you 10 + 10 + 10 seconds before resetting instead of resetting earlier.
This is a script example - For Left 4 Dead 2:
PHP Code:
public void Event_InfectedDeath (Event event, const char[] name, bool dontBroadcast)
{
int victim = GetClientOfUserId (event.GetInt("userid")); if (IsClient (victim))
{
int team = GetClientTeam (victim); if (team == TEAM_INFECTED)
{
int attacker = GetClientOfUserId (event.GetInt("attacker"));
if (IsValidClient (attacker, TEAM_SURVIVOR)) if (!IsFakeClient (attacker))
/*I'm doing some long stuff here, didnt want to bother*/
/*bluh bluh bluh*/
/*bluh bluh bluh*/
/*I created timer to stop the abilities after 10 seconds*/
CreateTimer (10.0, StopTimer, attacker);
}
}
return;
}
PHP Code:
public Action StopTimer (Handle timer, any client)
{
/*I stopped everything here*/
}