Anti weapon hack.
#1

Hey there,

I'm trying to script my own anti weapon hack system, been searching for tutorials but didn't find any
I was wondering if anyone knows and could tell me how should I start and how does it work
(Please don't give me some links of anti cheat system releases, only tutorials, I want to script my own so I know how everything works in my script)

Thanks..
Reply
#2

Basically you create a GivePlayerWeaponEx function that logs how much ammo, and what weapons you receive (e.g. with 2 arrays, one stores the weapon id in a given weapon slot, the other one the ammo for that) Then you can check, e.g. when the player switches his weapon, if he really got the weapon he switched to, and if he doesnt got more ammo for it than he should have (you cant check the exact ammo, or you would need to know when exactly a player fires, and because the lag, and because timers/onplayerupdate/... wont be that exact ever, this is impossible)
There are some other things you also need to consider of course, like police cars (getting the shotgun), weapon pickups, etc.
Reply
#3

Quote:
Originally Posted by Mauzen
View Post
Basically you create a GivePlayerWeaponEx function that logs how much ammo, and what weapons you receive (e.g. with 2 arrays, one stores the weapon id in a given weapon slot, the other one the ammo for that) Then you can check, e.g. when the player switches his weapon, if he really got the weapon he switched to, and if he doesnt got more ammo for it than he should have (you cant check the exact ammo, or you would need to know when exactly a player fires, and because the lag, and because timers/onplayerupdate/... wont be that exact ever, this is impossible)
There are some other things you also need to consider of course, like police cars (getting the shotgun), weapon pickups, etc.
I know how to create such a function but for an example if I make a timer that checks all of the player weapons
how do I make it that if the player has a hacked weapon to get his weapons reset, I mean the function stores weapon id and the ammo that have been given to the player and not all of his weapons... I'm not sure of what I'm typing lol.. what I know that it works the same as the anti money cheat but could you explain me a little more about what I asked above?
Reply
#4

The GetPlayerAmmo function has been bugged for years, well it was back in the day when I was properly active on SA-MP it would return like 65545 a lot of the times so we had to end up just giving each weapon unlimited ammo then just detect if the server had given them the gun if not ban.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)