Demotion Shield 1.0.0 (olds.ro) - Arms Race / GunGame add-on
============================================================
After a player is knifed down a level he cannot be demoted again for
olds_shield_time seconds, and (olds_shield_samekiller 1) the player who demoted
him last cannot demote him again until someone else has. One knife player can
no longer farm a single victim. The kill itself still counts; only the level
loss is undone.
Requirements
- AMX Mod X 1.10.0.5490 or newer, with ReAPI (ReGameDLL_CS)
- an Arms Race / GunGame core (library "armsrace") with the natives
ar_get_level(id) and ar_set_level(id, level). Optional: the pre-forward
ar_knife_demote_pre(victim, killer) (PLUGIN_HANDLED keeps the level). A core
with other names can be connected through a small bridge plugin.
Install
1. Compile scripting/olds_demshield.sma and copy olds_demshield.amxx to
addons/amxmodx/plugins/.
2. Copy data/lang/olds_demshield.txt to addons/amxmodx/data/lang/.
No downloads: chat text.
Settings (addons/amxmodx/configs/plugins/olds_demshield.cfg, made on first run)
olds_shield_time 20 seconds a demoted player cannot be demoted again
olds_shield_samekiller 1 the last demoter cannot demote him again
olds_shield_notify 1 chat lines when a shield starts or blocks
Players
say /shield the seconds left on your own shield, or "no shield"
How it works
- With the core's pre-forward the plugin simply answers it.
- Without it: RG_CBasePlayer_Killed (pre) notes a kill made with the knife
in hand (m_pActiveItem is WEAPON_KNIFE) by a direct hit, and the victim's
level; 0.1 s after the kill (after the core has handled it) a lower level
means a demotion. A blocked one is undone with ar_set_level; an allowed
one starts the shield and records the demoter.
- A knife kill that costs no level (level 1) starts no shield.
- Shields and demoters are cleared when a player leaves and with the map.