Bob_Marley

[PAWNO] Auto Restart v2.0

Jan 31st, 2015
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.86 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnGameModeInit()
  4. {
  5.     SendRconCommand("password 0");
  6.     SetTimer("OnRestart", 1000, 1);
  7.     return 1;
  8. }
  9.  
  10. public OnRestart();
  11. public OnRestart()
  12. {
  13.     new time[3], string[32];
  14.     gettime(time[0],time[1],time[2]);
  15.     if(time[0] == 4 && time[1] == 29 && time[2] == 0) return SendClientMessageToAll(-1, "Restart the server happens after 1 minute.");
  16.     if(time[0] == 4 && time[1] == 30 && time[2] == 0)
  17.     {
  18.         SendClientMessageToAll(-1, "Server is restarted...");
  19.         for(new i = 0; i < MAX_PLAYERS; i++) SetTimerEx("sKick", 1000, false, "i", i);
  20.         format(string, sizeof string, "password %s", random(9999)+time[2]);
  21.         return SendRconCommand(string);
  22.     }
  23.     if(time[0] == 4 && time[1] == 31 && time[2] == 0) return SendRconCommand("gmx");
  24.     return 1;
  25. }
  26. public sKick(playerid);
  27. public sKick(playerid) return Kick(playerid);
Advertisement
Add Comment
Please, Sign In to add comment