SA-MP Forums Archive
About tod - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: About tod (/showthread.php?tid=339099)



About tod - ChrisRedfield00 - 02.05.2012

Hi im experiencing a Problem About my tod if i change the time to /tod 1 The time Still got no effect IG It just like When i use /tod 1 the Time gone Fast and Back it to normal

here is my 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);
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: About tod - MP2 - 02.05.2012

Are you syncing time with SetPlayerTime anywhere?


Re: About tod - Emil123 - 02.05.2012

Try with this

//----------------------------------[TOD]-----------------------------------------------

if(strcmp(cmd, "/tod", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /tod [timeofday] (0-23)");
return 1;
}
new hour;
hour = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
SetWorldTime(hour);
format(string, sizeof(string), " Time set to %d:00.", hour);
BroadCast(COLOR_GRAD1, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command!");
}
}
return 1;
}


Re : About tod - ChrisRedfield00 - 02.05.2012

Are you syncing time with SetPlayerTime anywhere?


What is syncing time with Setplayertime

this is the problem if i set the time its not stable its just back with the same time >.<


Re : Re: About tod - ChrisRedfield00 - 02.05.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
Are you syncing time with SetPlayerTime anywhere?
What you mean Syncing


Re : Re: About tod - ChrisRedfield00 - 02.05.2012

Quote:
Originally Posted by Emil123
Посмотреть сообщение
Try with this

//----------------------------------[TOD]-----------------------------------------------

if(strcmp(cmd, "/tod", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /tod [timeofday] (0-23)");
return 1;
}
new hour;
hour = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
SetWorldTime(hour);
format(string, sizeof(string), " Time set to %d:00.", hour);
BroadCast(COLOR_GRAD1, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command!");
}
}
return 1;
}
i get alot of errors if i use that


Re : Re: About tod - ChrisRedfield00 - 03.05.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
Are you syncing time with SetPlayerTime anywhere?

chu mean syncing?


Re: About tod - MadeMan - 03.05.2012

Do you use SetPlayerTime or TogglePlayerClock in your script?


Re : Re: About tod - ChrisRedfield00 - 03.05.2012

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Do you use SetPlayerTime or TogglePlayerClock in your script?
I Forgot how can i check it lol Btw my script is so old that why i forgot it >.< Can you help me i think its setplayertime


Re: About tod - MadeMan - 03.05.2012

Press Ctrl+F to search.