Ammunition of the player's current weapon
#4

https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
https://sampwiki.blast.hk/wiki/GetPlayerAmmo

If both of those functions give you the total ammunition per weapon, then for each weapon's total ammo divide it with the amount of rounds it can shoot per clip.

Deagle with 56 ammo, 7 rounds per clip: 56/7 = 8 clips remaining

If you don't get a whole number, then assume that:

Deagle with 52 ammo, 7 rounds per clip: 7.4285.. clips left = 7, ammo left = 0.4285... * 7 (rounds per clip, not the clips left) = 2.99 (round to 3)
Reply


Messages In This Thread
Ammunition of the player's current weapon - by Volumen - 17.02.2019, 00:17
Re: Ammunition of the player's current weapon - by d3Pedro - 17.02.2019, 00:31
Re: Ammunition of the player's current weapon - by Volumen - 17.02.2019, 00:48
Re: Ammunition of the player's current weapon - by ComDuck - 17.02.2019, 05:55
Re: Ammunition of the player's current weapon - by TheToretto - 17.02.2019, 09:55

Forum Jump:


Users browsing this thread: 1 Guest(s)