Detecting ammo.
#3

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:
pawn Код:
new weapons, ammo;
GetPlayerWeaponData(playerid, 2, weapons, ammo);
Then, to check if there are no bullets left, just do
pawn Код:
if(!ammo)
    // yup, out of bullets
Edit
Why not also use the function GetPlayerWeaponState and check:
pawn Код:
if(GetPlayerWeaponState(playerid) == WEAPONSTATE_NO_BULLETS)
// same as
if(!GetPlayerWeaponState(playerid))
Reply


Messages In This Thread
Detecting ammo. - by Darnell - 30.08.2011, 15:09
Re: Detecting ammo. - by [MWR]Blood - 30.08.2011, 15:13
Re: Detecting ammo. - by AndreT - 30.08.2011, 15:13
Re: Detecting ammo. - by Kar - 30.08.2011, 15:16
Re: Detecting ammo. - by Darnell - 30.08.2011, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)