27.05.2009, 14:06
No it's not more efficient. But you still can do with only one array, like in this example:
Then you can do
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.
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)]
pawn Код:
PlayerDelay(playerid, CMD_MYCOMMAND) = gettime();
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.