SetWorldTime
#1

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?
Reply
#2

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);
}
Reply
#3

....
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)