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



Inifnite ammo. - Don_Cage - 11.09.2013

When someone uses infinite ammo hack, does the server still count the ammo down to 0?


EDIT: I mean that the server still count down and when it comes down to 0 it just get back in 'fullclip'


Re: Inifnite ammo. - JimmyCh - 11.09.2013

Not really, they just don't lose ammo, it won't ever go to 0.
Even if you have given them like 500 ammo on a weapon, no matter how much they shoot, it stays on 500.
That's infinite ammo hacking.


Re: Inifnite ammo. - Don_Cage - 11.09.2013

Then, is there a way to detect that?


Re: Inifnite ammo. - Isolated - 11.09.2013

Not 100% sure, but you could try, logging the ammo every few seconds, then OnPlayerTakeDamage checking for ammo hacks?


Re: Inifnite ammo. - Konstantinos - 11.09.2013

I guess there are few ways. The first thing comes to my mind is:

Check in OnPlayerKeyStateChange if the newkeys is KEY_FIRE and if they hold a weapon that it uses ammo (to prevent weapons such as knife etc). When a player shoots, the callback I mentioned will be called so you can get the ammo. The next time will be called again, compare the ammo with the previous you stored somewhere. If the difference is 0, then he's using cheats.