SA-MP Forums Archive
hey can someone make this or tell me how to make it? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: hey can someone make this or tell me how to make it? (/showthread.php?tid=89322)



hey can someone make this or tell me how to make it? - [mad]MLK - 01.08.2009

i would like to put something in my GM that restarts the server every 12 hours for updates ect, but how would i do it , i know i would need to use a line of code like sendrconmessage but im not sure how to do the timers



Re: hey can someone make this or tell me how to make it? - Criss_Angel - 01.08.2009

Try Making a Timer its easy to make


Re: hey can someone make this or tell me how to make it? - arnutisz - 01.08.2009

pawn Код:
//OnGameModeInt

SetTimer("restart", 1000*60*60*12, 0);

//somewhere, like at the bottom of script

forward restart();
public restart()
{
  SendRconCommand("gmx");
}



Re: hey can someone make this or tell me how to make it? - MadeMan - 01.08.2009

Another option

pawn Код:
forward GameModeRestart();

public OnGameModeInit()
{
    SetTimer("GameModeRestart", 43200000, false); // 43,200,000 milliseconds is 12 hours
    return 1;
}

public GameModeRestart()
{
    GameModeExit();
}



Re: hey can someone make this or tell me how to make it? - Criss_Angel - 01.08.2009

Quote:
Originally Posted by MadeMan
Another option

pawn Код:
forward GameModeRestart();

public OnGameModeInit()
{
    SetTimer("GameModeRestart", 43200000, false); // 43,200,000 milliseconds is 12 hours
    return 1;
}

public GameModeRestart()
{
    GameModeExit();
}
That's better option just in-case


Re: hey can someone make this or tell me how to make it? - [mad]MLK - 01.08.2009

hey thanks guys, I put you're names in the server /credits