Gamemode.PlayerCanPickupWeapon

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePlayerCanPickupWeapon
SyntaxGM:PlayerCanPickupWeapon( Player Player, Weapon Weapon )
DescriptionHook this to override whether the player can pick weapons up.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerCanPickupWeapon]Gamemode.PlayerCanPickupWeapon [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

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


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox