Garry's Mod Wiki

GM:AllowPlayerPickup

boolean GM:AllowPlayerPickup( Player ply, Entity ent )

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

1 Player ply
The player trying to pick up something.
2 Entity ent
The Entity the player attempted to pick up.

Returns

1 boolean
Allow the player to pick up the entity or not.

Example

Allows only admins to pick up things

hook.Add( "AllowPlayerPickup", "AllowAdminsPickUp", function( ply, ent ) return ply:IsAdmin() end )

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 3
Generate Html 7
SaveChanges (1) 10
Render Body 0
Render Sidebar 11