ReGameDLL_CS Documentation

repository·master·Indexed 21 days ago

https://github.com/rehlds/regamedll_cs

A reverse-engineered replacement for the Counter-Strike 1.6 GameDLL (mp.dll/cs.so) based on HLDS build 6153beta. It provides improved stability and an extended API for developers building mods and plugins. The documentation covers installation, build instructions for Windows and Linux, configuration via CVars for gameplay and bots, and a developer API for managing player connections, purchasing, and menu displays.

Tokens
4.1K
Snippets
9
Records
16
Agent score
23%

What's inside ReGameDLL_CS

  1. Overview of ReGameDLL_CS

    master
    ReGameDLL_CS is a reverse-engineered version of the original Counter-Strike 1.6 GameDLL (mp.dll / cs.so), based on the HLDS build 6153beta. It aims to provide a more stable version of Counter-Strike than the official release while offering an extended API for mods and plugins.
  2. Build ReGameDLL_CS on Windows

    master

    To build the project on Windows, you need Visual Studio 2015 (C++14 standard) or a later version.

    1. Open the solution file msvc/ReGameDLL.sln in Visual Studio.
    2. Select either Release or Debug from the solution configurations list to begin the build.
  3. Build ReGameDLL_CS on Linux

    master

    Building on Linux requires git >= 1.8.5 and cmake >= 3.10. You can use GCC (>= 4.9.2), ICC (>= 15.0.1), or LLVM/Clang (>= 6.0).

    Use the build.sh script with the following options:

    • -c|--compiler=[icc|gcc|clang]: Select the preferred C/C++ compiler.
    • -j|--jobs=[N]: Specify the number of simultaneous jobs for faster building.

    Definitions (-D):

    • DEBUG: Enables debugging mode.
    • USE_STATIC_LIBSTDC: Enables static linking of libstdc++.
    ./build.sh --compiler=gcc
    ./build.sh --compiler=intel
    ./build.sh --compiler=clang
  4. Install ReGameDLL_CS

    master

    ReGameDLL_CS is fully compatible with the official Valve Counter-Strike 1.6 and Counter-Strike Zero mods. To install it, download the appropriate binaries and replace the original mp.dll (Windows) or cs.so (Linux) in your server files.

    Warning: ReGameDLL_CS is not binary compatible with the original HLDS because it is compiled with different compilers. Plugins that rely on binary code analysis (such as Orpheu) will likely fail to work.

    # Download binaries from:
    # Release builds: https://github.com/rehlds/ReGameDLL_CS/releases
    # Dev builds: https://github.com/rehlds/ReGameDLL_CS/actions/workflows/build.yml
    
    # Replace original mp.dll or cs.so with the downloaded version.
  5. Install zBot for CS 1.6

    master

    To add zBot functionality to your Counter-Strike 1.6 installation:

    1. Extract all files from the zBot archive into your game directory.
    2. Enable the bot functionality by setting the CVar bot_enable 1 in your cstrike/game_init.cfg file. If the file does not exist, create it.
    cstrike/game_init.cfg
    bot_enable 1
  6. How to use the ReGameDLL_CS beta version

    master

    A beta version is available that includes the latest changes from the official version of Counter-Strike. To use it, add the -beta flag to your HLDS command line arguments.

    ./hlds_run -game cs -console -beta ...
  7. Prepare Linux build environment (Debian / Ubuntu)

    master

    If you are on a Debian or Ubuntu-based system, ensure you have the necessary 32-bit libraries and build tools installed by running the following commands:

    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo apt-get install -y gcc-multilib g++-multilib
    sudo apt-get install -y build-essential
    sudo apt-get install -y libc6-dev libc6-dev-i386

    Afterward, install your preferred compiler:

    • For GCC/G++: sudo apt-get install -y gcc g++
    • For Clang: sudo apt-get install -y clang
    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo apt-get install -y gcc-multilib g++-multilib
    sudo apt-get install -y build-essential
    sudo apt-get install -y libc6-dev libc6-dev-i386
  8. Install CS:CZ hostage AI for CS 1.6

    master

    To add CS:CZ style hostage AI to your Counter-Strike 1.6 installation:

    1. Extract all files from the HostageImprov archive into your game directory.
    2. Enable the hostage AI by setting the CVar hostage_ai_enable 1 in your cstrike/game_init.cfg file. If the file does not exist, create it.
    cstrike/game_init.cfg
    hostage_ai_enable 1
  9. Configure ReGameDLL_CS via CVars

    master

    ReGameDLL_CS provides an extensive list of console variables (CVars) to customize gameplay mechanics, bot behavior, scoreboard displays, and round rules. These can be set in the server console or via configuration files.

    Key Configuration Categories

    Gameplay & Round Rules

    • mp_freeforall: Enables Free-For-All mode (1) or disables it (0).
    • mp_autoteambalance: Controls team balancing (0: disabled, 1: after next round, 2: next round).
    • mp_buytime: Sets round buy time in minutes. -1 for no limit, 0 to disable.
    • mp_maxmoney: Sets the maximum allowable money.
    • mp_round_infinite: Provides fine-grained control over round end conditions using flags (e.g., ae blocks round time and bomb round end checks).
    • mp_fraglimit: Sets a frag limit for map rotation. Use mp_fragsleft in console to check remaining frags.
    • mp_timelimit: Sets the time limit for map rotation. Use mp_timeleft in console to check remaining time.
    • mp_forcerespawn: Enables automatic respawning. Set to 0 to disable or >0.00001 for a specific delay.

    Item & Weapon Management

    • mp_weapondrop: Controls weapon drops on death (0: none, 1: best/heaviest, 2: active, 3: all).
    • mp_ammodrop: Controls ammo drops (0: always keep, 1: drop only on death, 2: drop when dropping weapon).
    • mp_infinite_ammo: Sets ammo modes (0: disabled, 1: infinite clip, 2: infinite backpack ammo).
    • mp_infinite_grenades: Enables infinite grenades (1) or disables them (0).
    • mp_free_armor: Gives free armor on spawn (1: Kevlar, 2: Kevlar + Helmet).
    • mp_t_default_weapons_secondary / mp_ct_default_weapons_secondary: Sets default pistols for Terrorists and Counter-Terrorists.

    Bot Configuration

    • bot_quota_mode: Sets quota type (normal, fill, or match).
    • bot_join_after_player: Controls when bots join (0: immediately, 1: strict wait for playable human, 2: soft wait for any human).
    • bot_freeze: Prevents bots from moving (1).

    Scoreboard & HUD

    • mp_scoreboard_showhealth: Controls HP visibility in scoreboard (-1: disabled, 3: teammates only, 4: all clients).
    • mp_scoreboard_showmoney: Controls Money visibility in scoreboard.
    • mp_show_bomb_timer: Shows the C4 countdown on the HUD round timer.
    • mp_playerid_showhealth: Controls player ID health display (1: teammates only, 2: all players).

    Damage & Combat

    • ff_damage_reduction_bullets: Reduces teammate damage from bullets (range 0 to 1).
    • ff_damage_reduction_grenade: Reduces teammate damage from grenades.
    • mp_knockback: Sets knockback force for strong weapons (e.g., AWP). Set to 0 to disable.
    • sv_autobunnyhopping: Enables automatic re-jumping while holding the jump button.
    • sv_enablebunnyhopping: Allows player speed to exceed maximum running speed.
    // Example: Block round time and bomb round end checks
    mp_round_infinite "ae"
    
    // Example: Set buy time to 2 minutes
    mp_buytime 2.0
    
    // Example: Enable infinite clip ammo
    mp_infinite_ammo 1
  10. ReGameDLL_CS Commands Reference

    master

    ReGameDLL_CS introduces or extends several commands for game management and testing. Note that some commands require sv_cheats 1 to be enabled.

    | Command | Description |
    | :--- | :--- |
    | `game version` | Shows GameDLL build version, date & URL. |
    | `endround` | Args: `T` (Terrorists win), `CT` (Counter-Terrorists win), or no args (terminate round draw). |
    | `swapteams` | Swaps teams and restarts (default 1s delay). Args: `0` (no restart), `>0.001` (delay in seconds). |
    | `give <weapon_name>` | Gives a weapon (e.g., `give weapon_ak47`). Requires `sv_cheats 1`. |
    | `impulse 255` | Gives all weapons. Requires `sv_cheats 1`. |
    | `impulse 200` | Enables Noclip with air acceleration. Requires `sv_cheats 1`. |
  11. Manage Player Connections and Disconnections

    master

    Use these functions to handle client lifecycle events such as connecting, disconnecting, or killing players.

    • BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason): Connects a client to the server. Use szRejectReason to provide feedback if the connection is denied.
    • void ClientDisconnect(edict_t *pEntity): Disconnects a client.
    • void ClientKill(edict_t *pEntity): Kills a specific client entity.
    • void ClientPutInServer(edict_t *pEntity): Places an entity into the server.
    • void SpectatorConnect(edict_t *pEntity): Connects a player as a spectator.
    • void SpectatorDisconnect(edict_t *pEntity): Disconnects a spectator.
  12. Handle Player Purchasing and Weapons

    master

    These functions allow for programmatic control over player weapon purchases and item acquisition.

    • void BuyPistol(CBasePlayer *pPlayer, int iSlot): Forces a player to buy a pistol at the specified slot.
    • void BuyShotgun(CBasePlayer *pPlayer, int iSlot): Forces a player to buy a shotgun at the specified slot.
    • void BuySubMachineGun(CBasePlayer *pPlayer, int iSlot): Forces a player to buy a submachine gun at the specified slot.
    • void BuyRifle(CBasePlayer *pPlayer, int iSlot): Forces a player to buy a rifle at the specified slot.
    • void BuyMachineGun(CBasePlayer *pPlayer, int iSlot): Forces a player to buy a machine gun at the specified slot.
    • void BuyItem(CBasePlayer *pPlayer, int iSlot): Purchases an item from the menu slot.
    • CBaseEntity *BuyWeaponByWeaponID(CBasePlayer *pPlayer, WeaponIdType weaponID): Attempts to purchase a weapon by its specific ID.
    • bool BuyGunAmmo(CBasePlayer *pPlayer, CBasePlayerItem *weapon, bool bBlinkMoney): Purchases ammunition for a specific weapon.
    • bool BuyAmmo(CBasePlayer *pPlayer, int nSlot, bool bBlinkMoney): Purchases ammunition for a weapon slot.
    • bool CanBuyThis(CBasePlayer *pPlayer, int iWeapon): Checks if a player is eligible to purchase a specific weapon.