GetPlayerWeaponData
From SA-MP Wiki
(Difference between revisions)
Revision as of 03:07, 4 February 2014 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 03:08, 4 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 29: | Line 29: | ||
[[Category:Scripting Functions]] | [[Category:Scripting Functions]] | ||
- | [[fr:GetPlayerWeaponData]] | ||
[[de:GetPlayerWeaponData]] | [[de:GetPlayerWeaponData]] | ||
+ | [[fr:GetPlayerWeaponData]] | ||
[[ru:GetPlayerWeaponData]] | [[ru:GetPlayerWeaponData]] |
Revision as of 03:08, 4 February 2014
Description:
Get the weapon and ammo in a specific player's weapon slot.
(playerid, slot, &weapons, &ammo)
playerid | The ID of the player whose weapon data to retrieve. |
slot | The weapon slot to get data for (0-12). |
&weapons | The variable in which to store the weapon ID, passed by reference. |
&ammo | The variable in which to store the ammo, passed by reference. |
Return Values:
This function does not return any specific values.
// Common use: get all weapons and store info in an array containing 13 slots // The first value is the weapon ID, and second is the 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 may be useful, as they are related to this function in one way or another.
- GetPlayerWeapon: Check what weapon a player is currently holding.
- GivePlayerWeapon: Give a player a weapon.