Teammate Grenade Damage Off 1.0.0 (olds.ro)
===========================================
HE grenades stop hurting the thrower's teammates and the thrower, while the
rest of friendly fire (bullets, knife) keeps working. Enemies take the full
blast as usual, and a kill made by the grenade is credited as usual.
Requirements
- ReHLDS, ReGameDLL_CS, Metamod-R, ReAPI
- AMX Mod X 1.10 or newer (written and tested on 1.10.0.5490)
- mp_friendlyfire 1 on the server. With mp_friendlyfire 0 the game already
spares teammates from HE grenades, and only olds_henofd_self has an effect.
Install
1. Compile scripting/olds_he_nofriendly.sma and copy olds_he_nofriendly.amxx
to addons/amxmodx/plugins/. The compiler needs ReAPI's include files
(reapi.inc and the reapi_*.inc files from the ReAPI release) next to the
stock AMX Mod X includes.
2. Copy data/lang/olds_he_nofriendly.txt to addons/amxmodx/data/lang/.
3. Copy configs/plugins/olds_he_nofriendly.cfg to addons/amxmodx/configs/plugins/
(if it is missing, the plugin writes it with the default values).
4. Add olds_he_nofriendly.amxx to addons/amxmodx/configs/plugins.ini.
How it works
- Every hit a player takes passes the ReAPI hook RG_CBasePlayer_TakeDamage
first. HE grenade damage (DMG_GRENADE) from the player's own grenade, or
from a grenade thrown by a teammate, is stopped there; anything else goes
through unchanged.
- A teammate is a player on the team the grenade was thrown for (the
thrower's team at the moment of the throw), the same rule the game uses
for HE friendly fire. It stays right when the thrower changes team or
leaves the server before the grenade goes off.
- In free-for-all (ReGameDLL's mp_freeforall 1) nobody is a teammate, so
only the self rule applies.
- Counter-Strike itself never pushes a living player with a blast. With
olds_henofd_knock 1 the plugin pushes a spared player away from the blast
with the strength the damage would have had (the Half-Life blast push
formula from the game code: about 5 units per second for each point of
damage, at most 1000).
Settings (addons/amxmodx/configs/plugins/olds_he_nofriendly.cfg)
olds_henofd_self 1 1 = a player's own HE grenade does not hurt them
olds_henofd_team 1 1 = an HE grenade does not hurt the thrower's teammates
olds_henofd_knock 0 1 = a spared player is still pushed away from the blast
Commands
None.
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, with bots and real HE grenades:
thrower and teammates unharmed, enemies hurt and killed (frag to the thrower),
rifle friendly fire still working, the push with olds_henofd_knock 1, each
cvar switched off, a thrower who changed team or left the server.
No sounds, models or sprites are added.
Credits and licence
Written from scratch by alexit (olds.ro workshop) for workshop card LIB-2266.
Licence: GNU GPL version 3 or later (GPL-3.0-or-later).