SA-MP Forums Archive
Fill all player weapons - 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: Fill all player weapons (/showthread.php?tid=301695)



Fill all player weapons - System64 - 05.12.2011

Hi all
I have a small problem, I want, when player choose item (In menu) for filling all weapons with ammo, it fill all weapons but there is a little 'bug', ex. I have 3 guns, eagle (id 24), sniper (id 34), minigun (id 3, it will fill all weapons with +1000 ammo but it will take ammo from last gun, so on this example, minigun have 500 ammo, it will give all weapons +1500 ammo, not 1000, understand?
pawn Код:
for(new i = 0; i < 13; i++)
{
    GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
    if(IsFirearm(weapons[i][0]))
    {
        GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1] + 1000);
    }
}