SA-MP Forums Archive
Add 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: Add ammo? (/showthread.php?tid=450960)



Add ammo? - RALL0 - 15.07.2013

Hey guys, I am wondering, is there such thing that adds ammo to certain weapons? Like once the dialog pops up and someone can choose ammo for lets say mp5 only how can I add ammo to that certain weapon?


Re: Add ammo? - mahdi499 - 15.07.2013

Use the Function SetPlayerAmmo

Ex.
pawn Код:
SetPlayerAmmo(playerid, WEAPON_SHOTGUN, 100);
this will put 100 ammo in the shotgun.


Re: Add ammo? - RALL0 - 15.07.2013

Ah, I wasn't aware of that function, do I need to define the weapons?


Re: Add ammo? - JimmyCh - 15.07.2013

You can use something like this:
pawn Код:
new Ammo = GetPlayerAmmo(playerid);
SetPlayerAmmo(playerid, YOURWEAPONIDHERE, Ammo+ 100);
Hope this helps