Skip to content

Quick Commands

ParadoxLeon edited this page Dec 13, 2024 · 1 revision

Adding Custom Quick Commands

This guide explains how to add your own custom quick commands to the CS2 Server Manager. Quick commands are predefined RCON commands that can be executed with a single button click on the web interface.

Steps to Add Custom Quick Commands

  1. Open the cs2manager.js File

    Locate the cs2manager.js file in the project directory. This is the main server-side script that defines the application behavior.

  2. Find the Quick Commands Section

    In the app.get('/') route handler, look for the section that defines the Quick Commands form. It will look something like this:

    <form action="/send-command" method="POST">
        <h3>Quick Commands</h3>
        <button type="submit" name="command" value="mp_restartgame 1">Restart Game</button>
    </form>
    
  3. Add Your Custom Command

    To add a new quick command, insert an additional <button> element inside the <form> block. For example, to add a command that changes the server time limit, add the following:

    <button type="submit" name="command" value="mp_timelimit 30">Set Time Limit to 30</button>

    Replace mp_timelimit 30 with the desired RCON command and update the button text to match the command's purpose.

  4. Save and Restart the Server

    After modifying the file, save your changes and restart the server to apply them.

    Example:

   <form action="/send-command" method="POST">
       <h3>Quick Commands</h3>
       <button type="submit" name="command" value="mp_restartgame 1">Restart Game</button>
       <button type="submit" name="command" value="mp_timelimit 30">Set Time Limit to 30</button>
       <button type="submit" name="command" value="mp_maxplayers 16">Set Max Players to 16</button>
   </form>
Clone this wiki locally