GM:PhysgunPickup

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

Contents

Description

Called whenever a player picks up an entity with the Physgun.

NOTE This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Arguments

Player player

The player that is picking up using the phys gun.

Arguments

Entity entity

The entity that is being picked up.

Returns

boolean

Returns whether the player can pick up the entity or not.

Examples

Example

Allows Admins to pick up players.

local function PlayerPickup(ply, ent)
	if ( ply:IsAdmin() and ent:GetClass():lower() == "player" ) then
		return true
	end
end
hook.Add("PhysgunPickup", "Allow Player Pickup", PlayerPickup)


Personal tools
Navigation