Player/GetWeapons

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Func |Name=GetWeapons |Parent=Player |Description=Returns a table of the player's weapons | Returns = {{Return| table| weapons}} |Realm=Shared |IsClass=Yes }} {{Ret ...")
 
Line 2: Line 2:
 
|Name=GetWeapons
 
|Name=GetWeapons
 
|Parent=Player
 
|Parent=Player
|Description=Returns a table of the player's weapons
+
|Description=Returns a table of the player's weapons.
| Returns = {{Return| table| weapons}}
+
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes
Line 9: Line 8:
 
{{Ret
 
{{Ret
 
|type=table
 
|type=table
|desc= weapons
+
|desc=All the weapons the player currently has.
 
}}
 
}}
 
{{Example
 
{{Example
| Description = Prints how many weapons the player has
+
|Description=Prints how many weapons the player has.
| Code = print(table.Count(Player(1):GetWeapons()))
+
|Code=print(table.Count(Player(1):GetWeapons()))
| Output = 5
+
|Output=The number of weapons the player has (e.g. 5).
 
}}
 
}}

Revision as of 12:28, 17 April 2014

 Player:GetWeapons( )

Contents

Description

Returns a table of the player's weapons.

Returns

table

All the weapons the player currently has.

Examples

Example

Prints how many weapons the player has.

print(table.Count(Player(1):GetWeapons()))

Output:

The number of weapons the player has (e.g. 5).
Personal tools
Navigation