GM/PhysgunPickup

From Garry's Mod
Revision as of 19:05, 4 December 2019 by Spar (Talk | contribs)
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.

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


Personal tools
Navigation