SA-MP Forums Archive
SetWorldTime - 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: SetWorldTime (/showthread.php?tid=418509)



SetWorldTime - Lemonaidz - 25.02.2013

So in my current FS i'm working on, iv'e made it so when i drive a certain vehicle and use a command it makes the server time Night

SetWorldTime(0);


Problem is it only stays night for 30 seconds max, how could i put a timer on this so it stays night when i use the command?


Re: SetWorldTime - Jewell - 25.02.2013

pawn Код:
new time; //on top

SetTimer("changetimer", 30000, true); //OnFilterScriptInit or OnGameModeInit

forward changetimer();
public changetimer()
{
    SetWorldTime(time);
    return 1;
}

CMD:settime(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "/st <Time>");
    time = strval(params);
    if(time > 24 || time < 0 ) return SendClientMessage(playerid, -1, "Angel: Invalid Hour!");
    return SetWorldTime(time);
}



Re: SetWorldTime - Lemonaidz - 25.02.2013

....


Re: SetWorldTime - Jewell - 25.02.2013

here
pawn Код:
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Party on DFT-30 LOADED");
print("--------------------------------------\n");
SetTimer("changetimer", 30000, true);
return 1;
}



Re: SetWorldTime - Lemonaidz - 25.02.2013

i done that, but it still changes after 1 minute, i think its gl_realtime thats taking over.