Time delay on commands
#8

No it's not more efficient. But you still can do with only one array, like in this example:
pawn Код:
enum
{
  CMD_MYCOMMAND,
  CMD_OTHERCMD,
   
  SIZEOF_DELAYS_ENUM
};

new PlayerDelays[MAX_PLAYERS * SIZEOF_DELAYS_ENUM];
#define PlayerDelay(%0,%1) PlayerDelays[%0+(%1*MAX_PLAYERS)]
Then you can do
pawn Код:
PlayerDelay(playerid, CMD_MYCOMMAND) = gettime();
or whatever.


A more efficient way than constantly using gettime(), is to increment a global variable in a repeating timer of 1 second and use this variable instead.
Reply


Messages In This Thread
Time delay on commands - by lol2112 - 26.05.2009, 21:20
Re: Time delay on commands - by Simon - 27.05.2009, 11:49
Re: Time delay on commands - by lol2112 - 27.05.2009, 12:01
Re: Time delay on commands - by yom - 27.05.2009, 12:10
Re: Time delay on commands - by lol2112 - 27.05.2009, 12:26
Re: Time delay on commands - by yom - 27.05.2009, 12:45
Re: Time delay on commands - by lol2112 - 27.05.2009, 13:25
Re: Time delay on commands - by yom - 27.05.2009, 14:06
Re: Time delay on commands - by lol2112 - 27.05.2009, 14:33
Re: Time delay on commands - by yom - 27.05.2009, 14:37

Forum Jump:


Users browsing this thread: 2 Guest(s)