17.02.2019, 05:55
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)
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)