Summary
Hooks
take_physcannon changes.true for a non-player entity held with the hands.IsDragged net var up to date.false while their ragdoll is dragged.false while the player holds an entity or for a second after they dropped one.take_physcannon config is on.Hooks
cwPickupObjects:CalculatePosition(player)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_plugin.lua:122Moves a player's grab entity to where the held entity should be, in front of their aim.
The distance grows while the player walks forward, and sprinting backwards pulls the entity close.
Parameters
- player Player The player holding the entity
Returns
- Boolean
truewhen the position was updated,nilwhen the player can no longer hold it
cwPickupObjects:CanHandsPickupEntity(player, entity, trace)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:188Implements hook CanHandsPickupEntity
Called when a player attempts to pick up an entity with the hands.
Allows movable physics props that nobody else holds and that do not set noHandsPickup, up to a
mass of 100 plus a strength bonus of up to 100; ragdolls are allowed at any mass. Plants and garbage
are never allowed.
Parameters
- player Player The player picking up
- entity Entity The entity to pick up
- trace Map The player's eye trace
Returns
- Boolean
trueto allow the pickup,falseto forbid it
cwPickupObjects:ClockworkConfigChanged(key, data, previousValue, newValue)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:59Implements hook ClockworkConfigChanged
Called when a config value changes; takes the gravity gun from, or gives it back to, every player
when take_physcannon changes.
Parameters
- key String The config key
- data Map The config's data table
- previousValue Any The old value
- newValue Any The new value
cwPickupObjects:ForceDropEntity(player)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_plugin.lua:33Makes a player drop the entity they are holding.
Removes the grab entity and restores the entity's collision group when prop_kill_protection is on.
With that config on, the dropped entity deals no damage for a minute; a dropped ragdoll also takes no
damage for a second. The player cannot punch for a second afterwards.
Parameters
- player Player The player dropping
Returns
- Entity The entity that was held, or
nilwhen the player held nothing
cwPickupObjects:ForcePickup(player, entity, trace)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_plugin.lua:78Makes a player pick up an entity with the hands, dropping anything they already held.
Spawns an invisible cw_grab entity at the trace hit position and welds the entity to it; the grab
then follows the player's aim. With prop_kill_protection on, the entity is switched to
COLLISION_GROUP_WEAPON while held.
Parameters
- player Player The player picking up
- entity Entity The entity to pick up
- trace Map The trace that hit the entity;
HitPosandPhysicsBoneare used
cwPickupObjects:ForceThrowEntity(player)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_plugin.lua:11Drops the entity a player is holding and throws it in the direction they aim.
Parameters
- player Player The player throwing
cwPickupObjects:GetEntityBeingHeld(entity)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:47Implements hook GetEntityBeingHeld
Called to get whether an entity is being held; returns true for a non-player entity held with the
hands.
Parameters
- entity Entity The entity to check
Returns
- Boolean
truewhen the entity is held, otherwisenil
cwPickupObjects:GetScreenTextInfo()
client gamemodes/catwork/plugins/pickupobjects/plugin/cl_hooks.lua:9Implements hook GetScreenTextInfo
Called to get the full-screen text; shows a "being dragged" notice while the local player's ragdoll is carried.
Returns
- Map Screen text info with
alphaandtitle, ornilwhen the player is not dragged
cwPickupObjects:KeyPress(player, key)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:146Called when a player presses a key; handles picking up, throwing and dropping with the hands.
With nothing held, secondary attack picks up the entity looked at within 96 units if the
CanHandsPickupEntity hook allows it, or knocks on a door. While holding, primary attack throws and
reload drops the entity.
Parameters
- player Player The player pressing the key
- key Number The key, one of the
IN_*enums
cwPickupObjects:OnePlayerSecond(player, curTime)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:117Implements hook OnePlayerSecond
Called every second for each player; pauses the unragdoll timer of a ragdoll that is being held and
keeps the IsDragged net var up to date.
Parameters
- player Player The player being processed
- curTime Number The current time
cwPickupObjects:PlayerCanGetUp(player)
shared gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:107Implements hook PlayerCanGetUp
On the server
Called when a player attempts to get up; returns false while their ragdoll is dragged.
Parameters
- player Player The ragdolled player
Returns
- Boolean
falseto stop the player getting up
On the client
Called when the local player attempts to get up; returns false while their ragdoll is dragged.
Parameters
- player
Returns
- Boolean
falseto stop the player getting up
Defined in
cwPickupObjects:PlayerCanThrowPunch(player)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:27Implements hook PlayerCanThrowPunch
Called when a player attempts to punch; returns false while the player holds an entity or for a
second after they dropped one.
Parameters
- player Player The punching player
Returns
- Boolean
falseto block the punch
cwPickupObjects:PlayerCharacterUnloaded(player)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:10Implements hook PlayerCharacterUnloaded
Called when a player's character has unloaded; drops whatever the player was holding.
Parameters
- player Player The player whose character unloaded
cwPickupObjects:PlayerEnteredVehicle(player, vehicle, class)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:98Called when a player enters a vehicle; drops the vehicle if the player was holding it.
Parameters
- player Player The player entering
- vehicle Vehicle The vehicle
- class Number The seat role
cwPickupObjects:PlayerGetHoldingEntity(player)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:17Implements hook PlayerGetHoldingEntity
Called to get the entity a player is holding; returns the entity picked up with the hands.
Parameters
- player Player The player to check
Returns
- Entity The held entity, or
nilwhen the player holds nothing
cwPickupObjects:PlayerGiveWeapons(player)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:37Implements hook PlayerGiveWeapons
Called when a player's weapons are given; removes the gravity gun from the spawn weapons when the
take_physcannon config is on.
Parameters
- player Player The player receiving weapons
cwPickupObjects:PlayerRagdollCanTakeDamage(player, ragdoll, inflictor, attacker, hitGroup, damageInfo)
server gamemodes/catwork/plugins/pickupobjects/plugin/sv_hooks.lua:82Implements hook PlayerRagdollCanTakeDamage
Called when a player's ragdoll is about to take damage; protects dragged ragdolls.
A ragdoll takes no damage for a second after it is dropped, and while held it only takes explosion, bullet, club and slash damage.
Parameters
- player Player The ragdolled player
- ragdoll Entity The player's ragdoll
- inflictor Entity The entity that dealt the damage
- attacker Entity The entity responsible for the damage
- hitGroup Number The hit group, one of the
HITGROUP_*enums - damageInfo CTakeDamageInfo The damage
Returns
- Boolean
falseto block the damage