SA-MP Forums Archive
[HELP] How to ? - 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: [HELP] How to ? (/showthread.php?tid=145838)



[HELP] How to ? - johnnyc - 04.05.2010

Hello everyone, i need to know how i can script a auto restart in my gamemode and to be like every 12 hours ? (by rcon gmx automaticly )
and before like 5 minutes i can send /rcon say server will restart in 5 minutes
i wanna do this while i am not IG / Console ( add it to my GM so its like automatic ) this can happen ?


Re: [HELP] How to ? - Rac3r - 04.05.2010

Код:
forward TwelveHourRestart();
forward RestartWarning();

SetTimer("RestartWarning", 1000*60*60*12 - 300000, 0);
SetTimer("TwelveHourRestart", 1000*60*60*12, 0);

public RestartWarning()
{
  SendClientMessageToAll( COLOR_YOU_ADD, "BLAH BLAH, SERVER WILL RESTART IN 5 MINUTES BLAH BLAH");
  return 1;
}
public TwelveHourRestart()
{
  SendRconCommand("gmx");
  return 1;
}
Only thing I'm unsure about is the timer calculations (1000*60*60*12). Goodluck anyway.


Re: [HELP] How to ? - johnnyc - 04.05.2010

Thanks, 43200000 = 12 hours i think, anyway whats the minimum time i need to try it.


EDIT: It works but it doesnt send the message