Timer danger
#1

Why SetTimerEx dangerous? And PVar is cool?
Reply
#2

SetTimerEx are roughly 25% off.
So i prefer including *****'s fixes2 and use SetTimerEx_

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

or just use onplayerupdate. more accurate
pawn Код:
static Timer[MAX_PLAYERS][2], bool:TimerRepeat[MAX_PLAYERS][2];
public OnPlayerUpdate(playerid)
{
    if(gettime() - Timer[playerid][0] > 3 && TimerRepeat[playerid][0] == false)
    {
        SendClientMessage(playerid, -1, "3 seconds have passed and this message will not be shown again.");
        Timer[playerid][0] = gettime();
    }
    if(gettime() - Timer[playerid][1] > 3 && TimerRepeat[playerid][1] == true)
    {
        SendClientMessage(playerid, -1, "3 seconds have passed and this message will be shown again in 3 seconds.");
        Timer[playerid][1] = gettime();
    }
    return 1'
}
correct me if the code was wrong. didnt test it
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)