Garry's Mod Wiki

Player:HasWeapon

boolean Player:HasWeapon( string className )

Description

Returns if the player has the specified weapon

Arguments

1 string className
Class name of the weapon

Returns

1 boolean
True if the player has the weapon

Example

prints if the player has the physgun

print( Entity( 1 ):HasWeapon( "weapon_physgun" ) )
Output: "true" in console, if player 1 has Physics Gun.

Page Links


Special Pages


Wikis

?

Render Time: 77ms

DB GetPage 50
Generate Html 3
SaveChanges (1) 9
Render Body 0
Render Sidebar 13