Gamemode.PhysgunPickup

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePhysgunPickup
SyntaxGM:PhysgunPickup( Player ply, Entity ent )
DescriptionDetermines whether a player can pick up an entity with the Physgun.
ReturnsBoolean Allow Pickup
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PhysgunPickup]Gamemode.PhysgunPickup [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionAllows super admins to pick up players.
Used onNewerShared.png
Code
function PlayerPickup(ply, ent)
	//If the player is a super admin, and the entity is a player
	if ply:IsSuperAdmin() and ent:GetClass():lower() == "player" then
		return true -- Allow pickup
	end
end
 
hook.Add("PhysgunPickup", "Allow Player Pickup", PlayerPickup)
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox