SA-MP Forums Archive
Running 1 or 2 timers in a public function? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Running 1 or 2 timers in a public function? (/showthread.php?tid=307516)



Running 1 or 2 timers in a public function? - Face9000 - 30.12.2011

Hello guys,i've this public function: (example).

pawn Код:
public Anticheat()
(
if(health == 100.0)
                {
                    SetTimer("HealthArmourCheat", 5000, true);
                {
        continue;
        }
    if(armour == 100.0)
                {
                    SetTimer("HealthArmourCheat", 5000, true);
    }
    }
    return 1;
This is a unique timer that has Health and Armour anticheat,this 2 has ONE single public/forward.
My question is: I need to run 1 for every "if" (2 same timers total) or just 1 timer globally?


Re: Running 1 or 2 timers in a public function? - Jefff - 30.12.2011

One global or SetTimerEx for connected player


Re: Running 1 or 2 timers in a public function? - ғαιιοцт - 30.12.2011

I'd run just one global timer that loops trough all olayers, checks if they are connected, and then checks if they are cheating.