GetAvailableWeapons

From NPC for VCMP 0.4 Servers
Revision as of 18:30, 8 May 2023 by Habi (talk | contribs) (Created page with "{{Welcome|desc=Returns all the weapons possessed by npc as an array| params=<source lang="lua">NoParams</source>| retvals=an array whose values are the IDs of the weapons possessed by the npc. The weaponid 0 (fists) is excluded.| relfuncs= *SelectWeapon *GetAmmoOfMyWeapon| example= <source lang="lua"> local a = GetAvailableWeapons(); SendChat("I have "+ a.len()+" weapons.");</source> }}")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Description:
Returns all the weapons possessed by npc as an array


Parameters:

NoParams


Return Values:
an array whose values are the IDs of the weapons possessed by the npc. The weaponid 0 (fists) is excluded.


Example

local a = GetAvailableWeapons();
SendChat("I have "+ a.len()+" weapons.");

Related Functions

The following functions may be helpful as they relate to this function in one way or another.