Help: gettickcount
#4

if you compare a player-saved timestamp with the GetTickCount, then its a good idea to change the == to a >=
pawn Код:
if(variable[playerid] != 0)
{
    // Functions here
    if(GetTickCount() - TimeTickCount[playerid] >= 4000)
    {
        TimeTickCount[playerid] = GetTickCount();//save the new servertime after the command: the player has to wait 4 seconds in order to pass the second command execution
        // Functions here
        return 1;
    }
    return 1;
}
this prevents the function execution to at least 4 ms in between. do you want a delay of 4 seconds btw? if so, change the 4 to 4000 - its milliseconds.
Reply


Messages In This Thread
Help: gettickcount - by NewbieScripter - 22.08.2012, 08:15
Re: Help: gettickcount - by AndreT - 22.08.2012, 08:19
Re: Help: gettickcount - by NewbieScripter - 22.08.2012, 08:21
Re: Help: gettickcount - by Babul - 22.08.2012, 09:19
Re: Help: gettickcount - by NewbieScripter - 22.08.2012, 10:10
Re: Help: gettickcount - by Babul - 22.08.2012, 11:02

Forum Jump:


Users browsing this thread: 1 Guest(s)