Timers decrease lag?
#10

Quote:
Originally Posted by admigo
Посмотреть сообщение
I have a one second timer with lots of variables like:
Код:
if(HasRobbedRecently[playerid]>=1)
{
 HasRobbedRecently[playerid]--;
}
Is this a problem?
Do you use that to limit how often someone can rob? If so, why do you need a timer for that? Instead use tickcount, for example:

pawn Код:
new HasRobbedRecently[MAX_PLAYERS];

if((tickcount() - 60000) < HasRobbedRecently[playerid]) return SendClientMessage(playerid, COLOR_RED, "Error, you cannot rob now");// Player has not waited 60 seconds
else
{
    // Player has waited 60 seconds...do the robbery
    HasRobbedRecently[playerid] = tickcount();
}
Doing it that way will avoid using timers and make things a lot cleaner
Reply


Messages In This Thread
Timers decrease lag? - by Admigo - 05.05.2012, 18:15
Re: Timers decrease lag? - by JaTochNietDan - 05.05.2012, 18:17
AW: Timers decrease lag? - by vyper - 05.05.2012, 18:18
Re: Timers decrease lag? - by FalconX - 05.05.2012, 18:21
Re: Timers decrease lag? - by Admigo - 05.05.2012, 19:21
Re: Timers decrease lag? - by Face9000 - 05.05.2012, 19:29
Re: Timers decrease lag? - by Admigo - 05.05.2012, 20:02
Re: Timers decrease lag? - by SuperViper - 05.05.2012, 20:18
Re: Timers decrease lag? - by Admigo - 05.05.2012, 20:59
Re: Timers decrease lag? - by JaTochNietDan - 05.05.2012, 21:05

Forum Jump:


Users browsing this thread: 2 Guest(s)