Raised This Month: $ Target: $400
 0% 

Cumulative Timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 07-14-2022 , 15:15   Cumulative Timer
Reply With Quote #1

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[] namebool 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 (attackerTEAM_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.0StopTimerattacker);
        }
    }
    return;



PHP Code:
public Action StopTimer (Handle timerany client)
{
    
/*I stopped everything here*/


Last edited by alasfourom; 07-15-2022 at 00:15.
alasfourom is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode