Limiting ammo
#1

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
Reply
#2

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);
    }
}
Reply
#3

Hello!

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

Mencent
Reply
#4

Thanks R0 +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)