Gamemode.GravGunPickupAllowed

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameGravGunPickupAllowed
SyntaxGM:GravGunPickupAllowed( Player player, Entity ent )
DescriptionCalled when a player picks up an entity with the gravity, can be allowed or disallowed.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.GravGunPickupAllowed]Gamemode.GravGunPickupAllowed [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionDetermine whether or not a player can pick up the entity, in this case it disallows it if the entity is a player. The weight limit may be set high enough to do this.
Used onNewerServer.png
Code
 
function GM:GravGunPickupAllowed( ply, ent )
	if (ent:GetClass() == "player") then
                ply:PrintMessage(HUD_PRINTTALK, "You can't pick up players!")
		return false 
	end
	return true 
end
 
OutputThe player is disallowed from picking up other players, and is sent a message if he tries to.


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox