cw_stunstick weapon
Weapon defined in entities/weapons/cw_stunstick
Defines the cw_stunstick weapon, the Civil Protection stun baton.
Primary fire strikes a player or prop within 96 units for club damage that scales with the owner's strength
attribute and runs the PlayerStunEntity hook. Secondary fire knocks on a door (PlayerCanKnockOnDoor,
PlayerKnockOnDoor) or pushes whatever is aimed at. The client draws a pulsing glow on the baton while it is
raised.
Summary
Methods
idle is set.Methods
Plays the draw animation.
Returns
- Boolean Always
trueto allow the deploy
SWEP:DoAnimations(idle)
shared gamemodes/cwhl2rp/schema/entities/weapons/cw_stunstick/shared.lua:245Plays the owner's attack animation unless idle is set.
Parameters
- idle Boolean optional, defaults to
nilWhether to skip the attack animation
Plays the swing animation with a spark, flesh hit or impact sound and the stunstick impact effect.
The effect and hit sounds only play when the owner's eye trace hits something within 96 units; otherwise a swing sound plays.
Draws the stunstick with a pulsing glow at its tip while raised.
SWEP:Holster(switchingTo)
shared gamemodes/cwhl2rp/schema/entities/weapons/cw_stunstick/shared.lua:85Plays the holster animation.
Parameters
- switchingTo
Returns
- Boolean Always
trueto allow the holster
Sets the melee hold type.
Plays a spark sound and, for Civil Protection models, the baton deactivation animation.
Plays a spark sound and, for Civil Protection models, the baton activation animation.
Plays the door knock sound, mirrored to the owner's client when called on the server.
Plays the push sound, mirrored to the owner's client when called on the server.
Strikes whatever the owner aims at within 96 units.
Players are pushed back and, while above 10 health, take club damage that scales with the owner's
strength. Physics props are pushed and take more damage; ragdolled players take the player damage.
Fires the PlayerStunEntity hook for every hit.
Knocks on a door within 64 units or pushes the player, NPC or prop being aimed at within 96 units.
Knocking needs the PlayerCanKnockOnDoor hook to allow it and fires PlayerKnockOnDoor. Pushing plays
the Civil Protection push animation for those models.
Draws the pulsing glow and spark sprites on the view model while raised.