Trouble with /tod
#1

Basically, whenever I try to set the server time, it quickly changes and doesn't save. It will change for a second and instantly go back. Iv'e tried multiple times to fix the issue but cant seem to come up with it. If anyone can help me please comment below, if you could help any other way , my skype is : tom.repalone
Код:
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;
}
Reply
#2

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.
Reply
#3

Quote:
Originally Posted by Jay_
Посмотреть сообщение
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.
I tried removing evey case of setworldtime and it didn't work, there is no FS. I must be missing something, can anyone help?
Reply
#4

Try this, Untested.

pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)