GetPlayerWeaponData
From SA-MP
[edit]
GetPlayerWeaponData
Read the weapon and ammo in a specific weapon slot of a player.
(playerid, slot, &weapons, &ammo)
| playerid | ID of the player |
| slot | Weapon slot to read (0-12) |
| &weapons | Weapon ID will be returned by reference here |
| &ammo | Ammunition will be returned by reference here |
This function does not return a specific value, it's best to simply ignore it.
//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]); }
[edit]
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- ResetPlayerWeapons: Reset all weapons of a player
- GivePlayerWeapon: Give a weapon to a player.
