SA-MP Forums Archive
Ammo Change (idea for anti ammo hack) - 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 Change (idea for anti ammo hack) (/showthread.php?tid=554437)



Ammo Change (idea for anti ammo hack) - DavidBilla - 03.01.2015

https://sampforum.blast.hk/showthread.php?tid=326614
This is pretty effective against weapon hacks, but if the player hacks ammo for an existing weapon, this doesn't detect.
I was half way through my script which detects ammo too but i got stuck at the place where I'll have to detect when ammo of a player changes, i decided to use GetPlayerAmmo in a 1 second timer, but the problem is, some weapons can shoot several bullets in a second, if i find out a way to trigger a function everytime the ammo of a player changes (for holding weapon).
If i get to find out a way, I'll be able to make a decent anti weapon/ammo hack script.

So is there a way to trigger a function everytime a single bullet for a weapon changes (Ofcourse without making a 1 millisecond timer :-p )?


Re: Ammo Change (idea for anti ammo hack) - Sledgehammer - 03.01.2015

https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot
- Try OnPlayerWeaponShot.


Re: Ammo Change (idea for anti ammo hack) - DavidBilla - 03.01.2015

Quote:
Originally Posted by Death1300
Посмотреть сообщение
Well the problem is that i heard it doesn't detect sniper bullets and other weapons like RPG which has got Ammo but which can't be actually called as bullets


Re: Ammo Change (idea for anti ammo hack) - Sledgehammer - 03.01.2015

Quote:

Only bullet weapons are supported. Only passenger drive-by is supported (not driver drive-by, and not sea sparrow / hunter shots).

Should be supported, however I can't think of any other way of detecting bullets with out using timers.


Re: Ammo Change (idea for anti ammo hack) - DavidBilla - 03.01.2015

Any ideas to detect every bullets shot by any weapon (even tec9, minigun,RPG etc) would be useful, with or without a timer


Re: Ammo Change (idea for anti ammo hack) - DavidBilla - 04.01.2015

Hoping someone could answer it...