GM/PhysgunPickup

From Garry's Mod
Revision as of 03:19, 5 December 2019 by Code gs (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 GM:PhysgunPickup( )

Contents

Description

Called to determine if a player should be able to pick up an entity with the Physics Gun.

See GM:OnPhysgunPickup for a hook which is called when a player has successfully picked up an entity.

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 Physics 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.

hook.Add( "PhysgunPickup", "AllowPlayerPickup", function( ply, ent )
	if ( ply:IsAdmin() and ent:IsPlayer() ) then
		return true
	end
end )


Personal tools
Navigation