Solved Timed server shutdown

Discussion in 'Plugin Requests' started by Upperking, Nov 11, 2014.

  1. Since rust is so unstable it would be nice to have a autorestart plugin with a save.all and countdown.
     
  2. Wulf

    Wulf Community Admin

    It could only provide shutdown and save, not actual restarting.
     
  3. yes please..
     
  4. Wulf

    Wulf Community Admin

    But then we'd need to figure out how to issue a server command programmatically first. ;)
     
  5. server.stop?
     
  6. Wulf

    Wulf Community Admin

    It's not a matter of what command to use, it's a matter of actually issuing the command via Lua. The correct command would be quit though.
     
  7. You don't have to run the quit command, just call the function directly like the modification I posted to the save plugin.
     
  8. Wulf

    Wulf Community Admin

    Yeah, I forgot all about that, even though I use some functions like that as well!
     
  9. Hi all.
    My English is bad but I will try to explain


    I need plugin that will automatically perform a closing rust server command "quit" when the clock ServerPC is 5:59.
    Is this possible?

    Example: (SouceMod)
    Code:
    #pragma semicolon 1
    #include <sourcemod>public Plugin:myinfo =
    {
        name = "Autorestart",
        author = "Cockfish",
        description = "",
        version = "1.0",
        url = "",
    }public OnPluginStart()
    {
        CreateTimer(60.0, CheckTime, 0, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
    }public Action:CheckTime(Handle:timer)
    {
        decl String:sTime[16];
        new gettime = GetTime();
      
        FormatTime(sTime, sizeof(sTime), "%H%M", gettime);
        new time = StringToInt(sTime);      if(time == 0559)
        {
            Restart();
        }
        else
        {
            return;
        }
    }public Restart()
    {
        ServerCommand("quit"),
        LogAction(0, -1, "Gameserver was restarted successfully.");
    }
     
    Last edited by a moderator: Feb 2, 2015
  10. Wulf

    Wulf Community Admin

    Yes, but are you wanting it for Legacy or Experimental?
     
  11. Anyway to make a plugin to be able to restart your server from in-game so that other mods/admins can restart when needed?
     
  12. Wulf

    Wulf Community Admin

    No, the best you can do is shut the server down using the quit command. You'd have to write an external script or use software to actually start the server.
     
  13. Experimental (linux)
    [DOUBLEPOST=1422883261,1422845338][/DOUBLEPOST]Perhaps it will be easier:
    Instead, need the plugin which is can save the map every 10-30 minutes or ServerPC 5:59?

    My server reboots every day at 6:00
    If you do not save the map, it will be empty each time?
     
  14. +server.saveinterval xx
    xx- time in second's
    60*30=1800 sec
     
  15. My english very bad, sorry.

    Possibly make plugin with timer for quit?
    Sample:
    Admin type in chat /timer xx (xx- time in minute).
    /timer 20 => in game all players message "20 minute for shutdown server!!!" and every 5 minutes message is repeats:
    15 minute for shutdown server!!!
    10 minute for shutdown server!!!
    5 minute for shutdown server!!!
    1 minute for shutdown server!!!

    Shutdown!!!
    and quit in console.

    I hope you understand me )))
     
  16. Wulf

    Wulf Community Admin

    Rust does have a built-in restart command now, with countdown.
     
  17. I try it but it seems that just reastarting not saving as save plugin

    which command are you using and is there any other command for it?
     
  18. any reply pls?
     
  19. Wulf

    Wulf Community Admin

    The "restart" command in Rust works, with a countdown of 60 seconds. You could always have a plugin setup to save OnServerShutdown.
     
  20. thanks a lot
    by the way I am trying to reach to you from private chat for correct my birth day
    could you please correct it