ULX

Author Topic: Daily server restarter  (Read 11935 times)

0 Members and 1 Guest are viewing this topic.

Offline captain1342

  • Full Member
  • ***
  • Posts: 104
  • Karma: 6
  • Quality is our standard
    • Aperture Development - Quality is our standard
Daily server restarter
« on: February 04, 2017, 06:36:29 PM »
First of all it is not a real Restarter, it just stops the server you need an external script to automaticly restart it after my script stopped your server!

Link to the Addon: https://github.com/captain1242/LUA-Codes/tree/master/GMod%20Addons/server_auto_restarter

Description:

This script Automaticly restarts your server every day at local 3 o'clock AM. It "annoys" you with Messages 1 Hour, 30 Minutes, 15 Minutes, 10 Minutes and 5-1 Minutes before the restart then it Kicks all players with reason:
"Server Restart! \nTry connecting in 5 Minutes! \nIf the server isn't online then \nplease contact an Admin!"

It also adds serval In-Game commands and Permissions to those commands ( Warning you need ULX )

Commands are:

In Game:
!restart - Restarts server Instantly
!rs menu - Opens the RestartSystem Menu
!rs abort - Disables Auto Restart
!rs autorestart - Enables Auto Restart

Server Console:
autorestart_abort - Disables Auto Restart
autorestart_restart - Enables Auto Restart


If you want to change anything on it such as Restart time or "annoying" messages feel free to modify the code.

Why I made this script? Well one of my servers beginns to lag due to serval internet updates of scripts like VCmod so I need to restart the server every day but I am too lazy to do that manually so I made this script real quick
Aperture Development
Quality is our standard

Website - GitHub  - Forum  - Steam  - Discord

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Daily server restarter
« Reply #1 on: February 05, 2017, 12:22:24 PM »
Once you get to know me, you'll find you'll have never met me at all.

Offline captain1342

  • Full Member
  • ***
  • Posts: 104
  • Karma: 6
  • Quality is our standard
    • Aperture Development - Quality is our standard
Re: Daily server restarter
« Reply #2 on: February 05, 2017, 01:17:25 PM »
Well yours does something I wanted to implement .. currently it Does just: Restart at 3:00 AM with warnings and an in game Restart Command .. I just made it cause I am Lazy AF XD I was even so lazy I didn't searched if someone done something simelar
Aperture Development
Quality is our standard

Website - GitHub  - Forum  - Steam  - Discord

Offline Taylorr<3/only.fans

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Daily server restarter
« Reply #3 on: June 24, 2020, 02:45:33 AM »
Do I have to worry about players having access to these commands?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Daily server restarter
« Reply #4 on: June 24, 2020, 05:48:46 PM »
Well, would you want random players to be able to shutdown or cancel shutdown?
It's for superadmin by default.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming