21.02.2013, 21:56
So I'm using this code:
And why I can't set ammo for current player selected weapon with this code? Player ammo doesn't changes
GetWeaponSlot:
pawn Code:
ammo = GetPlayerAmmo(playerid);
amount = 100;
new total = ammo - amount;
SetPlayerAmmo(playerid, GetWeaponSlot(playerid, GetPlayerWeapon(playerid)), total);
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;
}