- Documentation
- Shared functions
- getSlotFromWeapon
Function
getSlotFromWeapon
Returns the inventory slot (0-12) a weapon ID goes into.
Syntax
int getSlotFromWeapon(int weapon)Arguments
weaponint- Weapon ID.
Returns
The slot number or false.
Example
print(getSlotFromWeapon(31))
See also
getWeaponsInSlotReturns the weapon IDs that belong to an inventory slot.getPedWeaponReturns the ID of the weapon a ped is holding (0 = fists), or of the weapon in the given inventory slot. Slots are weapon groups: 0 fists, 1 melee, 2 handguns, 3 shotguns, 4 sub-machine guns, 5 assault rifles, 6 rifles, 7 heavy weapons, 8 grenades, 9 sprays and extinguishers, 10 gifts, 11 goggles and parachute, 12 detonator. On the client it returns only the weapon in hand.