can set player ammo
#1

So I'm using this code:
pawn Code:
ammo = GetPlayerAmmo(playerid);
amount = 100;
new total = ammo - amount;
SetPlayerAmmo(playerid, GetWeaponSlot(playerid, GetPlayerWeapon(playerid)), total);
And why I can't set ammo for current player selected weapon with this code? Player ammo doesn't changes

GetWeaponSlot:
pawn Code:
stock GetWeaponSlot(playerid,weapon)
{
    new weid,ammo;

    for(new slot=0; slot < 13; slot++)
    {
        new slotas;
        GetPlayerWeaponData(playerid,slotas,weid,ammo);
        if(weid == weapon)
        {
            return slotas;
        }
    }
    return -1;
}
Reply


Messages In This Thread
can set player ammo - by Daslee - 21.02.2013, 21:56
Re: can set player ammo - by Vince - 21.02.2013, 22:04
Re: can set player ammo - by Daslee - 22.02.2013, 11:14
Re: can set player ammo - by sampreader - 22.02.2013, 11:16
Re: can set player ammo - by Daslee - 26.02.2013, 10:41

Forum Jump:


Users browsing this thread: 1 Guest(s)