cw_keys weapon
Weapon defined in core/entities/weapons/cw_keys
Defines the cw_keys weapon, which locks the entity the owner looks at with primary fire and unlocks it with
secondary fire.
The PlayerGetLockInfo and PlayerGetUnlockInfo hooks supply the duration and the callback that does the work, and
PlayerCanLockEntity or PlayerCanUnlockEntity must keep allowing the action, within 192 units, until the timed
lock or unlock action ends.
Summary
Methods
lock or unlock action on the entity the owner looks at within 192 units.Methods
Plays the fists draw animation.
SWEP:Holster(switchingTo)
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_keys/shared.lua:73Plays the holster animation and allows the keys to be holstered.
Parameters
- switchingTo
Starts locking the entity the owner looks at within 192 units.
PlayerGetLockInfo supplies the lock duration, callback and sound flag; PlayerCanLockEntity must allow it
and keep allowing it until the timer ends.
SWEP:SecondaryAttack()
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_keys/shared.lua:136Starts unlocking the entity the owner looks at within 192 units.
PlayerGetUnlockInfo supplies the unlock duration, callback and sound flag; PlayerCanUnlockEntity must
allow it and keep allowing it until the timer ends.
SWEP:StartKeyAction(action, infoHook, canHook)
shared gamemodes/catwork/gamemode/core/entities/weapons/cw_keys/shared.lua:85Starts a timed lock or unlock action on the entity the owner looks at within 192 units.
Does nothing while the owner is already locking or unlocking. The info hook supplies the duration, callback and sound flag; the permission hook must allow the action and keep allowing it until the timer ends.
Parameters
- action String Name of the action,
lockorunlock - infoHook String Hook that returns the action's info, such as
PlayerGetLockInfo - canHook String Hook that allows the action, such as
PlayerCanLockEntity