25.06.2015, 06:43
Sorry if this issue was discussed before, but I've heard that GetPlayerWeaponData is a bad way of getting player's weapon data, so I was wondering if there was something else someone made that works better.
stock GetPlayerWeaponAmmo(playerid, weaponid)
{
new current_weapon = GetPlayerWeapon(playerid);
new ammo = 0;
SetPlayerArmedWeapon(playerid, weaponid);
if(GetPlayerWeapon(playerid) == weaponid)
{
ammo = GetPlayerAmmo(playerid);
SetPlayerArmedWeapon(playerid, current_weapon);
}
return ammo;
}
I've heard that GetPlayerWeaponData is a bad way of getting player's weapon data |