Help with a timer to use the command per minute.
#8

You don't need a timer to do this guys:

pawn Код:
//global
new
  gLastTime[ MAX_PLAYERS ] = 0;

//connect and disconnect
gLastTime[ playerid ] = 0;

//text or command or pm, wherever you want
if ( ( gettime() - gLastTime[ playerid ] ) < SOME_AMOUNT_OF_SECONDS )
{
  //they are spamming so tell them or return false ?
}
else gLastTime[ playerid ] = gettime();
That will run only when they actually send a text and not every ** amount of seconds like a timer would.

Timers slow your sync, always best to use a work around when possible (well most cases).
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)