Server-side hooks of the Affective wounds plugin that count the hits a player takes to the legs and arms and apply their effects.
PlayerTraceAttack keeps the counts on the player as cwLegShots and cwArmShots. When the leg count reaches
affectivewounds_legshotlimit the player falls over for 5 seconds, and when the arm count reaches
affectivewounds_armshotlimit the active weapon is dropped as an item unless its class is in the local
NoStripWeps list. PlayerCharacterLoaded resets the counters, starting Overwatch and Civil Protection characters
below zero so that they take extra hits.
Summary
Hooks
Hooks
PLUGIN:PlayerCharacterLoaded(ply)
server gamemodes/cwhl2rp/plugins/affectivewounds/plugin/sv_hooks.lua:42Implements hook PlayerCharacterLoaded
Called after a player's character has loaded; resets the leg and arm hit counters.
Parameters
- ply Player The player whose character loaded
PLUGIN:PlayerTraceAttack(ply, dmginfo, dir, trace)
server gamemodes/cwhl2rp/plugins/affectivewounds/plugin/sv_hooks.lua:57Called when a player is hit by a traced attack; counts limb hits and applies their effects.
Once the leg hit count reaches affectivewounds_legshotlimit the player falls over for 5
seconds; once the arm count reaches affectivewounds_armshotlimit the player drops the
active weapon as an item, unless it is listed in NoStripWeps. Counters then reset.
Does nothing when the plugin is disabled, for unaffected factions, in vehicles or in noclip.
Parameters
- ply Player The player being hit
- dmginfo CTakeDamageInfo The damage being dealt
- dir Vector Direction of the attack
- trace Map Trace result;
HitGroupdecides which limb was hit