Sunucu tanitimi

CSB Ammo Packs is the currency layer a zombie or boss server needs before it can have a shop. Players earn ammo packs for kills, headshots and round wins; balances are persisted per SteamID in nVault, so they survive reconnects and map changes.

Other plugins spend and grant packs through three natives — csb_get_packs(id), csb_set_packs(id, amount) and csb_add_packs(id, amount) — so an extra-items menu or VIP shop can be built on top without touching this plugin's storage. /packs shows your balance and admins can grant packs with csb_givepacks.

Inspired by the ammo-pack economy of Zombie Plague. This is an independent GPL re-implementation; no original code is reused.

Features

  • Earn packs for kills (csb_packs_kill), headshots (csb_packs_headshot) and round wins (csb_packs_roundwin).
  • Starting balance for new SteamIDs (csb_packs_start) and an optional cap (csb_packs_max).
  • Persisted per SteamID in nVault; loaded on connect, saved on change and on disconnect.
  • Natives csb_get_packs / csb_set_packs / csb_add_packs for shop/extra-item plugins.
  • /packs balance display and csb_givepacks admin grant.

Using the natives

In another plugin you can declare the natives yourself, for example:

native csb_get_packs(id);
native csb_set_packs(id, amount);
native csb_add_packs(id, amount);

Then check csb_get_packs(id) before an item purchase and call csb_set_packs(id, balance - price) to charge for it.

Installation

  1. Make sure the nvault module is enabled in addons/amxmodx/configs/modules.ini.
  2. Compile and copy csb_ammo_packs.amxx into addons/amxmodx/plugins/.
  3. Add it to plugins.ini, above any plugin that calls its natives.
  4. Change the map. The vault file appears in addons/amxmodx/data/vault/ on the first save.