GetPlayerSlotAmmo: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome| desc=This will return the ammo of the weapon which is at the specified slot of the player| params=<syntaxhighlight lang="lua">( playerId, slotId )</syntaxhighlight>...")
 
No edit summary
 
Line 5: Line 5:
::slotId: The Slot ID ( 0 -9 ) on which the ammo of weapon available is to be determined
::slotId: The Slot ID ( 0 -9 ) on which the ammo of weapon available is to be determined
</poem>|
</poem>|
retvals= -1, if the player is not connected. Otherwise returns the ammo of the weapon on the slot. If invalid slot is specified, it returns 0 (fists )|
retvals= -1, if the player is not connected. Otherwise returns the ammo of the weapon on the slot. If invalid slot is specified, it returns 0 (fists no ammo )|
relfuncs=*[[GetPlayerSlotWeapon]]
relfuncs=*[[GetPlayerSlotWeapon]]
*[[GetSlotFromWeaponId]]
*[[GetSlotFromWeaponId]]
}}
}}

Latest revision as of 18:49, 26 November 2022


Description:
This will return the ammo of the weapon which is at the specified slot of the player


Parameters:

( playerId, slotId )

playerId: The ID of the player whose weapon is to be checked
slotId: The Slot ID ( 0 -9 ) on which the ammo of weapon available is to be determined


Return Values:
-1, if the player is not connected. Otherwise returns the ammo of the weapon on the slot. If invalid slot is specified, it returns 0 (fists no ammo )



Related Functions

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