30.08.2011, 15:13
Judging from this, pistols are in slot 2 (this would be different for every weapon-specific clip that you take out of your inventory). To get the weapon data of slot 2, do this:
Then, to check if there are no bullets left, just do
Edit
Why not also use the function GetPlayerWeaponState and check:
pawn Код:
new weapons, ammo;
GetPlayerWeaponData(playerid, 2, weapons, ammo);
pawn Код:
if(!ammo)
// yup, out of bullets
Why not also use the function GetPlayerWeaponState and check:
pawn Код:
if(GetPlayerWeaponState(playerid) == WEAPONSTATE_NO_BULLETS)
// same as
if(!GetPlayerWeaponState(playerid))