11.10.2015, 12:23
Hi!
In my script, i have this part:
And i need your help... Is that good, or is better to create one global timer in OnGameModeInit, and it will work like this:
And timer will repeat every 4 seconds, for ex...
I need your help, because i think, when 300 players enter any command, automatically will be activated 300 Timers, and that timers will slow server too much... I think this foreach looping will be better...
In my script, i have this part:
Код:
if(PlayerInfo[playerid][pAdmin] < 1) Commands[playerid] ++; if(Commands[playerid] >= 1) { KillTimer_H(CommandsTimer[playerid]); CommandsTimer[playerid] = SetTimerEx("ResetCommands",4000,false,"i",playerid); } if(Commands[playerid] == 3) SendClientMessage(playerid, COLOR_LIGHTBLUE,"* Slow down with commands!"); if(Commands[playerid] == 5) { SendClientMessage(playerid,COLOR_LIGHTRED, "You are kicked!"); KillTimer_H(CommandsTimer[playerid]); Kick(playerid); }
Код:
public Timer() { foreach(Player, i) { If(Commands[i] > 0) Commands[i] = 0; } return 1; }
I need your help, because i think, when 300 players enter any command, automatically will be activated 300 Timers, and that timers will slow server too much... I think this foreach looping will be better...