08.12.2012, 22:45
Ok, my server has a custom clock i made, but sometimes the weathers get bugged on certain times, and i decided to make a command which changes the world's time and sets the clock to the number i set using the settime command, but the problem is, the command can go over 24 to 25 26 and 27, when i want it to restart to 0 after 24.
pawn Код:
CMD:settime(playerid, params[])
{
new time;
if(sscanf(params, "ii", time)) return SendClientMessage(playerid, GRAY, "Function : /settime [ hour ]");
if(time < 0 || time > 24) return SendClientMessage(playerid, GRAY, "The available hours are 0-24 ! ");
if(!sscanf(params, "ii", time))
{
new name[MAX_PLAYER_NAME], mestring[128];
GetPlayerName(playerid, name, sizeof(name));
format(mestring, sizeof(mestring), "%s has changed San Andreas Time to %d", name, time);
SendClientMessageToAll(GRAY, mestring);
SetWorldTime(time);
V_ToggleClock();
V_ToggleClock(time, 0);
return 1;
}
return 1;
}