08.02.2014, 16:19
Quote:
There might be an internal timer in your script which handles time. Search for SetWorldTime / SetPlayerTime in your script and check where's it's being handled.
If you create a /settime command make sure it uses the script current variables or things like these will happen. For example, if your time is stored at ServerTime, use that variable when changing the time dynamically. |
pawn Код:
CMD:settime(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "[ADMIN] - You're not a high enough level to use this command!");
new h;
if(sscanf(params, "i", h)) return SendClientMessage(playerid, COLOR_RED, "[USAGE] - /settime [0-24]");
if ( h < 0 || h > 24 ) return SendClientMessage( playerid, COLOR_RED, "[ERROR] - Use a number from 0 to 24" );
new name[MAX_PLAYER_NAME];
new string[94];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[TIME] - Admin %s[%d] has set the time to %i!", name, playerid, h);
SendClientMessageToAll(COLOR_GREEN, string);
format(string, sizeof(string), "[ADMIN] - %s[%d] has used SETTIME( %i )", name, playerid, h);
SendMessageToAdmins(COLOR_LIME,string);
SetWorldTime(h);
return 1;
}