Skip to content
View in the app

A better way to browse. Learn more.

Learn more

backpack-ammo-limits/README.txt

README.txt
72 lines · 3.2 KB · Text
Raw
Backpack Ammo Limits 1.0.0 (olds.ro)
====================================

Admins set the most reserve (backpack) ammo each weapon may carry, in a
config file. Ammo bought or picked up above the limit is not kept.

  - One line per weapon in addons/amxmodx/configs/olds_bpammo.ini, for
    example "weapon_ak47 120" or "weapon_awp 15". Weapons not listed keep
    the game's normal maximum.
  - Buying ammo at the limit is refused, so no money is spent. Ammo picked
    up above the limit (from the floor or a dropped gun) is thrown away.
  - Weapons that share an ammo type (for example the AK-47 and the Scout)
    share one reserve; when a player carries more than one of them, the
    smallest limit counts.
  - Grenades count too: "weapon_flashbang 1" lets a player carry one flash.
  - A line that is not "weapon_<name> <0-255>" is skipped and the AMX Mod X
    log names its line number.
  - amx_bpammo_reload reads the file again; the new limits apply to ammo
    given from then on and at each player's next spawn.
  - The plugin shows no text in the game and has no language file.

Requirements
  - ReHLDS, ReGameDLL_CS, Metamod-r, ReAPI
  - AMX Mod X 1.10.0.5490 or newer, with the cstrike module (enabled by
    default)

Install
  1. Compile scripting/olds_bpammo.sma and copy olds_bpammo.amxx to
     addons/amxmodx/plugins/. The compiler needs ReAPI's include files
     (reapi.inc and the reapi_*.inc files from the ReAPI release, in
     addons/amxmodx/scripting/include/) next to the stock AMX Mod X includes.
  2. Copy configs/olds_bpammo.ini to addons/amxmodx/configs/ and remove the
     ; in front of the limits you want (all examples are off at first).
  3. Copy configs/plugins/olds_bpammo.cfg to
     addons/amxmodx/configs/plugins/ and change the value if you want.
     (If the file is missing, the plugin writes one with the defaults the
     first time it starts.)
  4. Add olds_bpammo.amxx to addons/amxmodx/configs/plugins.ini.

Settings (addons/amxmodx/configs/plugins/olds_bpammo.cfg)
  olds_ba_enforce 1        1 = the limits apply; 0 = the plugin does nothing

Limits file (addons/amxmodx/configs/olds_bpammo.ini)
  weapon_<name> <0-255>    one weapon per line; empty lines and lines
                           starting with ; # or // are skipped

Commands
  amx_bpammo_reload        (ADMIN_CFG) reads olds_bpammo.ini again and
                           prints how many limits it read

Log
  L 12/05/2026 - 20:00:00: [olds_bpammo.amxx] olds_bpammo.ini line 4
  skipped: "weapon_bogus 10" is not "weapon_<name> <0-255>" for a weapon
  with ammo.
  L 12/05/2026 - 20:00:00: [olds_bpammo.amxx] olds_bpammo.ini: 2 backpack
  ammo limit(s) read.

How it works
  When the game gives ammo (ReAPI RG_CBasePlayer_GiveAmmo), its own
  maximum for that ammo is lowered to the limit, so the game itself stops
  there. Buying ammo at the limit (RG_BuyGunAmmo) is refused. At spawn and
  when a weapon is added, a reserve above the limit is cut with
  cs_set_user_bpammo.

Tested on
  ReHLDS 3.15.0.896, ReGameDLL_CS 5.30.0.814, Metamod-r 1.3.0.149,
  AMX Mod X 1.10.0-git5490, ReAPI 5.29.0.358.

Credits and licence
  Written from scratch by alexit (olds.ro workshop) for workshop card
  LIB-0097. Licence: GNU General Public License v3.0 or later
  (GPL-3.0-or-later).

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.