SA-MP Forums Archive
Ammo help - 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: Ammo help (/showthread.php?tid=564391)



Ammo help - kkeeii - 21.02.2015

Can someone help me how to make all weapon maximum ammo is 200 but the M4/AK47 is 500?


Re: Ammo help - Extremo - 21.02.2015

This is simple. Whenever a player is given a weapon or ammo, you check the ammo before-hand to ensure it doesn't exceed the limit you stated. If it does however, you refuse to give that person the weapon with the warning that it exceeds the ammo limit.

Use the following functions:

GetPlayerAmmo

or, since sometimes the weapon isnt scrolled:

GetPlayerWeaponData


Re: Ammo help - kkeeii - 21.02.2015

Man, I want all the weapons ammo must be only 200 and for the M4/AK47 are 500 not taking their AMMO.

Example: I give a gun to myself, I want it to be only 500 ammo because at my server when I giving a gun to my self its unlimited ammo.


Re: Ammo help - CalvinC - 21.02.2015

Then change the ammo you're giving in GivePlayerWeapon or SetPlayerAmmo.


Re: Ammo help - Extremo - 21.02.2015

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Then change the ammo you're giving in GivePlayerWeapon or SetPlayerAmmo.
This is what I meant with when a player is given a weapon. If you want to go the extra mile to reduce all ammo no matter where it is given, you're gonna have to do what I said and it'll definitely take longer. Just look up your command and change the functions named by CalvinC.


Re: Ammo help - kkeeii - 22.02.2015

Here is the PWN please help me.

http://pastebin.com/xp85bHma