22.10.2016, 17:37
PHP код:
CMD:setalltime(playerid,params[])
{
if(PlayerInfo[playerid][Level] >= 3)
{
new time;
if(sscanf(params "i", time))
{
SendClientMessage(playerid, red, "Usage: /settimeall [hour] ");
return 1;
}
if(time > 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);
SetPlayerTime(i, time , 0);
}
}
new string[65];
format(string, sizeof(string), "Administrator \"%s\" has set all players time to '%d:00'", pName(playerid), time);
return SendClientMessageToAll(blue, string);
}
else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
