GetAvailableWeapons: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(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> }}")
(No difference)

Revision as of 18:30, 8 May 2023


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.