02.04.2015, 12:14
I have a problem about setting a time.
Whats worng with this code:
Thanks.
Whats worng with this code:
Код:
CMD:setalltime(playerid,params[]) { if(PlayerInfo[playerid][Level] >= 4) { if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /setalltime [hour]"); new var = strval(params), string[128]; if(var > 24) return SendClientMessage(playerid, red, "ERROR: Invalid hour"); CMDMessageToAdmins(playerid,"SETALLTIME"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { PlayerPlaySound(i,1057,0.0,0.0,0.0); SetWorldTime(var); } } format(string,sizeof(string),"Administrator \"%s\" has set all players time to '%d:00'", pName(playerid), var ); return SendClientMessageToAll(blue, string); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }