08.12.2012, 23:37
Try this
pawn Код:
CMD:settime(playerid,params[]) {
if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /settime [hour]");
new name[MAX_PLAYER_NAME], mestring[128];
new time = strval(params);
if(time > 24) return SendClientMessage(playerid, red, "ERROR: Invalid hour");
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
SetPlayerTime(i, time, 0);}}
GetPlayerName(playerid, name, sizeof(name));
format(mestring, sizeof(mestring), "%s has changed San Andreas Time to %d", name, time);
SendClientMessageToAll(GRAY, mestring);
return 1;}