SA-MP Forums Archive
Looking for helping with /tod - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Looking for helping with /tod (/showthread.php?tid=477247)



Looking for helping with /tod - roncohen - 23.11.2013

Hello guys,
I have a bug with /tod everytime I'm do /tod It's change the hour to second and back to the previous hour what's that was before the changing.
The code:
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);
FixHour(time);
shifthour = time;
ghour = time;
wtime = 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;
}

Can do you help me?


Re: Looking for helping with /tod - BizzyD - 23.11.2013

Wrong section, post it in scripting discussion.

And to answer your question, probably a timer that sets the time.
CTRL + F & search for SetWorldTime