The Record Runs plugin for AMX Mod X is designed to record and playback player movements in Counter-Strike 1.6. It allows server administrators to capture and review player runs, which can be useful for analyzing gameplay, creating tutorials, or showcasing exceptional performances.
Dependent on the following module: https://github.com/human416c6578/ReplaysModule
Note: This plugin is not intended for standalone use. It requires integration with other plugins and can be controlled using native functions.
- Record and playback player movements.
- Adjustable bot play speed using the
/botcommand. - Ability to choose a replay file, pause, and stop the replay.
- Use native functions to save, load, reset, and manipulate replay files.
-
open_bot_menu(id)- Opens the bot control menu for the specified player.
-
reset_record(id)- Resets the recorded frames for the specified player, keeping the last 20 frames.
-
save_record(id, demo_time, demo_name, demo_path)- Saves the recorded frames for the specified player to a replay file.
-
load_record(path)- Loads a replay file from the specified path.
- Players can use the
/botcommand to adjust the bot play speed, choose a replay file, pause the replay, or stop it.
To seamlessly integrate the Record Runs plugin with your existing server setup, an example plugin has been provided. This integration example is encapsulated in the file named timer_records.sma.
-
Configuration Setup:
- The plugin defines essential configuration parameters, such as storage type and URL, using registered cvars (
g_cStorageTypeandg_cStorageUrl).
- The plugin defines essential configuration parameters, such as storage type and URL, using registered cvars (
-
Initialization:
- The
plugin_initfunction initializes the plugin by registering necessary cvars for storage configuration.
- The
-
Recording Setup:
- The plugin includes timer functions (
timer_player_recordandtimer_player_started) that handle the recording of player runs based on specific events.
- The plugin includes timer functions (
-
Directory Creation:
- The
plugin_cfgfunction creates the required directory structure for storing recordings. It ensures the existence of folders based on the map name and recording categories.
- The
-
Record Loading:
- The
timer_db_loadedfunction initiates the loading of recorded runs once the database is loaded. It determines whether to load records from a local directory or a web server based on the configured storage type.
- The
-
Web Server Interaction:
- Functions like
load_records_webserver,get_file, andhttp_get_file_completemanage interactions with a web server to fetch recorded run files.
- Functions like
-
File Upload System:
- Note: The example assumes the existence of a separate system for uploading files to the web server. In the
utilsfolder, you'll find a Python script (upload_files.py) designed to run periodically. This script handles the task of uploading recorded run files to the configured web server.
- Note: The example assumes the existence of a separate system for uploading files to the web server. In the
- The integration example is contained in the file named
timer_records.sma.
Follow this example to seamlessly incorporate the Record Runs functionality into your existing server environment. Ensure to deploy the Python script in the utils folder to handle the periodic uploading of recorded run files to the web server. Adjust the configuration parameters and event triggers according to your specific server requirements.