Buyable Antidote 1.0.0 (olds.ro) - Biohazard add-on
===================================================
An infected player may buy an antidote with money and turn back into a human:
say /antidote costs olds_ad_cost dollars; olds_ad_limit per round; not
sooner than olds_ad_delay seconds after the infection.
With olds_ad_firstzombie 0 the first zombies of the round (infected by the
game, without an attacker) cannot buy it.
Requirements
- AMX Mod X 1.10.0.5490 or newer, with ReAPI (ReGameDLL_CS); cstrike
- the Biohazard Zombie Core (library "olds_biohazard",
include/olds_biohazard.inc, workshop card LIB-0030)
Install
1. Compile scripting/olds_antidote.sma (scripting/include/olds_biohazard.inc
next to it) and copy olds_antidote.amxx to addons/amxmodx/plugins/, after
the core in plugins.ini.
2. Copy data/lang/olds_antidote.txt to addons/amxmodx/data/lang/.
No downloads: the cure plays the stock sound/items/medshot4.wav.
Settings (addons/amxmodx/configs/plugins/olds_antidote.cfg, made on first run)
olds_ad_cost 5000 price in dollars
olds_ad_limit 1 antidotes one player may buy per round
olds_ad_delay 5 seconds after the infection before it can be bought
olds_ad_firstzombie 1 0 = the first zombies of the round cannot buy it
How it works
- bh_fw_infected stamps the infection time; an infection without an
attacker marks a first zombie.
- /antidote checks, in order: living zombie, first-zombie rule, round limit,
delay, money (the reply says how much is missing). Then the core's
bh_cure turns the player back into a human; only if it worked is the
money taken (cs_set_user_money), the human model put back
(cs_reset_user_model) and the health set to 100.
- Everything per player is cleared at the round restart
(RG_CSGameRules_RestartRound), on death and on disconnect.