CMD:tod(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] >= 1337) { new string[128], time; if(sscanf(params, "d", time)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tod [time] (0-23)"); SetWorldTime(time); gTime = time; format(string, sizeof(string), "Time set to %d:00.", time); BroadCast(COLOR_GRAD1, string); } else { SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!"); } return 1; }
There is nothing causing the issue you described in that code. You need to research your other scripts, including filterscripts and includes, and look for other circumstances where the time is set. Also make sure you don't have the per-player clocks enabled, which display above the HUD.
|
CMD:tod(playerid, params[])
{
new string[128], input;
if (PlayerInfo[playerid][pAdmin] >= 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "d", time)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tod [time] (0-23)");
if(input > 23) return SendClientMessage(playerid, COLOR_GREY, "Hours are between 0 and 23.");
gettime(thour, tmin, tsec);
thour = input;
SetWorldTime(input);
format(string, sizeof(string), "AdmWarn: You have set the time to whatever you desired");
SendClientMessage(0xFFFFFFFF, 1, string);
return 1;
}