GetPlayerWeaponData

From SA-MP Wiki

Jump to: navigation, search

GetPlayerWeaponData


Read the weapon and ammo in a specific weapon slot of a player.


Parameters:
(playerid, slot, &weapons, &ammo)
playeridID of the player
slotWeapon slot to read (0-12)
&weaponsVariable to store the weapon ID, passed by reference
&ammoVariable to store the ammo, passed by reference


This function does not return a specific value.


//common use: get all weapons and store info in an array containing 13 slots
//first value is weapon id and second is ammo
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
    GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.

Personal tools