Timer danger
#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


Messages In This Thread
Timer danger - by Urukhay - 30.03.2014, 08:04
Re: Timer danger - by Evocator - 30.03.2014, 09:09
Re: Timer danger - by newbienoob - 30.03.2014, 09:31

Forum Jump:


Users browsing this thread: 2 Guest(s)