Skip to content
Adam Szerszenowicz edited this page Oct 18, 2024 · 26 revisions

User setup

Plugin installation

Plugin can be installed automatically or manually. Automatic installation is recommended since it's easier and faster than the manual approach.

Automatic installation

  1. Open your LocalAdmin terminal and execute the following command: p install Pogromca-SCP/SLCommandScript
  2. Restart your server once the plugin is installed.

Manual installation

  1. Download SLCommandScript.dll and dependencies.zip files from latest release.
  2. Place downloaded *.dll file in your server's plugins folder.
  3. Unzip the contents of the downloaded *.zip file into your server's plugin dependencies folder.
  4. Restart your server if it's already running.

File structure

Once you start your server with plugin installed you should see SLCommandScript folder created in your server's plugins directory. Inside you should see the following items:

  • scripts folder
  • pluginConfig.yml
  • scriptsLoaderConfig.yml

Files with *.yml extension store plugin configuration. You can find more details about configuration in section below. The scripts folder is the place where server scripts should be placed. By default it should contain 4 sub-directories. Scripts put in each folder will be registered to different consoles:

  • client -> Client in-game console
  • events -> Scripts from this folder are used for events handling
  • ra -> RemoteAdmin console
  • server -> LocalAdmin terminal (doesn't work on non-dedicated servers)

Note

Folders might be inactive or behave differently depending on configuration and used scripts loader implementation.

Creating scripts

To add new script create a file with *.slcs extension in a folder of your choosing. Once the file is created the plugin will attempt to register your new script to appropriate console. Your script won't be registered if a command with identical name or alias already exists, so you should always check commands in your target console before adding new scripts.

Note

Script names are case insensitive.

Tip

If your script's name is already taken, simply rename the file. The plugin will detect name change and try to register script with updated name. No server restarts needed.

Warning

RemoteAdmin suggestions won't show new scripts until next round restart.

To execute a script open your target console and input the name of your script without file extension. For example if you want to run a script test.slcs located in ra folder you need to open RemoteAdmin console and type test.

Tip

Client console also requires a dot prefix added to every script command. (ex. you should use .test instead of test)

To remove a script delete associated file or change its file extension. Removal might break other scripts if they were relying on removed script so always remove them with caution.

Creating event handlers

Scripts put in events folder are registered as event handlers. Those scripts are executed automatically by server when an appropriate in-game event occurs. They cannot be accessed from any console. The name of your script must match the name of the event you want to handle. Optional On prefix is also allowed if preferable. [TODO: LIST OF EVENTS]

Plugin configuration

[TODO: EXPLAIN CONFIGS]

Clone this wiki locally