Set Time -
raamiix - 16.03.2013
When I write /tod [time] will change it for three seconds, then change it back how do I fix this?
Код:
CMD:tod(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
new string[128], time;
if (!strlen(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tod [time] (0-23)");
time = strval(params);
if (time < 0 || time > 23) 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;
Re: Set Time -
Jstylezzz - 16.03.2013
There is probably a timer in your script, which sets the world time every x seconds.
Try searching for SetWorldTime in your script, and comment it if you find the timed one.
Re: Set Time -
raamiix - 16.03.2013
Quote:
Originally Posted by Jari_Johnson*
There is probably a timer in your script, which sets the world time every x seconds.
Try searching for SetWorldTime in your script, and comment it if you find the timed one.
|
if(!realtime)
{
SetWorldTime(wtime);
gTime = wtime;
}
__________________________________________________ __
if (realtime)
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
gTime = tmphour;
}
__________________________________________________ __
format(string, sizeof(string), "The time is now %d:00.",tmphour);
BroadCast(COLOR_WHITE,string);
ghour = tmphour;
TotalUptime += 1;
PayDay();
if (realtime)
{
SetWorldTime(tmphour);
gTime = tmphour;
}
__________________________________________________ __
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);
Re: Set Time -
Jstylezzz - 16.03.2013
I think it has something to do with the 'realtime' thing..
Check if there is a timer set for that, if so, delete the timer or comment it.
Re: Set Time -
raamiix - 16.03.2013
Quote:
Originally Posted by Jari_Johnson*
I think it has something to do with the 'realtime' thing..
Check if there is a timer set for that, if so, delete the timer or comment it.
|
Re: Set Time -
Jstylezzz - 16.03.2013
Not sure if that will do it, but try setting realtime to 0.