GM:AllowPlayerPickup

From Garry's Mod
Jump to: navigation, search
 GM:AllowPlayerPickup( )

Contents

Description

Called when a player tries to pick up something using the "use" key, return to override.

Arguments

Player ply

The player trying to pick up something.

Arguments

Entity ent

The Entity the player attempted to pick up.

Returns

boolean

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 )


Personal tools
Navigation