Jump to content

Change Stop Command


Hyro

Recommended Posts

https://github.com/HexaneNetworks/tcadmin-change_stop_command

TCAdmin Change Stop Command
A script to allow users to change their services stop command.

This is intended for the game Garry's Mod but can be modified to support others.

Stop Command Options
none - forcefully stop the service (kill the process).

quit and exit - gracefully stop the service.

custom - allow the user to hook into this command to run their own graceful shutdown routine.

Installation

  1. Navigate to your game template.
  2. Custom Scripts
  3. Create a new script:

    Operating System: Any
    Script Engine: IronPython
    Event: Custom icon
    Interval Limit: 1
    Prompt for variable values: Yes
    Name: Change Stop Command
    Icon URL: https://files.hexane.co/hyro/2304/be0eabc8d2.png
    Execute as the service's user: Yes
    Description: Change the Stop Command
    Ignore execution errors: Yes
    Sub admin access: Yes
    Reseller access: Yes
    User access: Yes
    Server owner access: Yes

    Paste the contents of tcadmin-change_stop_command.py into the code area.
     
  4. Save the script.
     
  5. Create another new script:

    Operating System: Any
    Script Engine: IronPython
    Event: Before stopped
    Description: Set Stop Command
    Ignore execution errors: Yes

    Paste the contents of tcadmin-set_stop_command.py into the code area.
     
  6. Save the script.
     
  7. Go back to your game template.
  8. Variables
  9. Create a new custom variable:

    Variable Name: StopCommand
    Preserve value: Yes
    Script parameter: Yes
    Save script parameter value: Yes
    Admin access: Yes
    Sub admin access: Yes
    Reseller access: Yes
    User access: Yes
    Server owner access: Yes
    Value is required: Yes
    Item Type: Combobox
    Label: Stop Command
    Source: Custom list

    Configure Items:

    Value: 
    Display Text: none
    Selected: Yes
    Value: quit
    Display Text: quit     
    Value: exit
     Display Text: exit   
    Value: custom
    Display Text: custom 
     
  10. Click Update
  11. Save the new custom variable.

 

Edited by Hyro
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 25 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use