GetPlayerWeapons: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "Returns an array of weapon hashes that contains all the weapons the player is currently holding. ==Syntax== <syntaxhighlight lang="C#" >WeaponHash[] NAPI.Player.GetPlayerWeap...")
 
No edit summary
 
Line 2: Line 2:


==Syntax==
==Syntax==
<syntaxhighlight lang="C#" >WeaponHash[] NAPI.Player.GetPlayerWeapons(Client player);</syntaxhighlight>
<syntaxhighlight lang="C#" >WeaponHash[] NAPI.Player.GetPlayerWeapons(Player player);</syntaxhighlight>


'''Required Arguments'''
'''Required Arguments'''
*'''player:''' parameter input should be in '''Client''' type.
*'''player:''' parameter input should be in '''Player''' type.


'''NOTE:''' This function returns data in '''WeaponHash[]''' type.
'''NOTE:''' This function returns data in '''WeaponHash[]''' type.

Latest revision as of 21:51, 22 December 2022

Returns an array of weapon hashes that contains all the weapons the player is currently holding.

Syntax

WeaponHash[] NAPI.Player.GetPlayerWeapons(Player player);

Required Arguments

  • player: parameter input should be in Player type.

NOTE: This function returns data in WeaponHash[] type.

Usage example(s)

Example Description

WeaponHash[] playerWeapons = NAPI.Player.GetPlayerWeapons(player);

foreach(WeaponHash weapon in playerWeapons) {
   // will loop through all player's weapons.
}