SA-MP Forums Archive
Limiting ammo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Limiting ammo (/showthread.php?tid=570572)



Limiting ammo - Hybris - 11.04.2015

Hello I was wondering how could I limit certain ammo in a gun for example I don't want a players ammo to go above 100


Re: Limiting ammo - R0 - 11.04.2015

here:
pawn Код:
new weaponammo[13], weaponid[13];
 
for (new i = 0; i <= 12; i++)
{
    GetPlayerWeaponData(playerid, i, weaponid[i], weaponammo[i]);
    if(weaponammo[i] > 100)
    {
        SetPlayerAmmo(playerid, weaponid[i], 100);
    }
}



AW: Limiting ammo - Mencent - 11.04.2015

Hello!

Work with this function:
GetPlayerAmmo or GetPlayerWeaponData.
https://sampwiki.blast.hk/wiki/GetPlayerAmmo
https://sampwiki.blast.hk/wiki/GetPlayerWeaponData

Mencent


Re: Limiting ammo - Hybris - 11.04.2015

Thanks R0 +rep