GM/AllowPlayerPickup
From Garry's Mod
GM:AllowPlayerPickup( )
Contents |
Description
Called when a player tries to pick up something using the "use" key, return to override.
See GM:GravGunPickupAllowed for the Gravity Gun pickup variant.
Arguments
Player ply
The player trying to pick up something.
Arguments
Entity ent
The Entity the player attempted to pick up.
Returns
Allow the player to pick up the entity or not.
Examples
Example
Allows only admins to pick up things
local function up( ply, ent ) return ply:IsAdmin() end hook.Add( "AllowPlayerPickup", "some_unique_name", up )