Перейти к содержанию

GetPlayerWeapons

Материал из RAGE MP Wiki Archive
Версия от 21:51, 22 декабря 2022; imported>Xabi
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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

Syntax

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

Required Arguments

  • player: parameter input should be in Player type.

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

Usage example(s)

Example Description <syntaxhighlight lang="C#" > WeaponHash[] playerWeapons = NAPI.Player.GetPlayerWeapons(player);

foreach(WeaponHash weapon in playerWeapons) {

  // will loop through all player's weapons.

} </syntaxhighlight>