Gamemode.PlayerCanPickupItem

From GMod Wiki

Revision as of 15:16, 17 February 2011 by BlackVoid (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePlayerCanPickupItem
SyntaxGM:PlayerCanPickupItem( Player Player, Weapon Item )
DescriptionHook this to override whether the player can pick item(s) up.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerCanPickupItem]Gamemode.PlayerCanPickupItem [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionThis stops the player from picking up a sent_ball
Used onNewerServer.png
Code
function GM:PlayerCanPickupItem(ply, item)
   if item:GetClass() == "sent_ball" then return false end
 
   return true
end
 
OutputN/A


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox