[HELP] How to ?
#1

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

Код:
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.
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)