GetPlayerWeapons

From GTA Network Wiki
Jump to: navigation, search

GetPlayerWeapons
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

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

Syntax

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

Required Arguments

  • player: parameter input should be in Client 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.
} 

Changelog

Version Description
1.0 Release.

References