15.11.2017, 20:54
Quote:
This one is better, and you won't need to script the loop inside every time command.
PHP Code:
PHP Code:
|
I don't recommend using a loop for that.
The default value of MAX_PLAYERS is 500 meaning that, the loop you're doing will run 500 times which is totally useless, unless you have 500 slots/players in your server.
Not only it's useless IMO, but if you have other loops running at the same time as this one, it may cause lag which is something your players wouldn't enjoy that much.
I recommend you to do this:
Quote:
Why not replacing it like this (much better than doing loop):
Code:
CMD:day(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] <= 2) return SendClientMessage(playerid, COLOR_RED, "ERROR: Insufficient Permissions!"); SetWorldTime(12); SendClientMessageToAll(COLOR_RED, "Server's time has been set to day time!"); return 1; } SetWorldTime |