Player.HasWeapon

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:HasWeapon( String WeaponClass )
Description:
Returns true if player has the weapon, otherwise false
Returns: Boolean
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.HasWeapon]Player.HasWeapon [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPrint true if the player 1 has the weapon weapon_rpg
Used onNewerServer.png
Code
pl=player.GetByID(1)
print( tostring( pl:HasWeapon("weapon_rpg") ) )
OutputTrue or false
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox