help with anti cheat
#1

Hello i was making anti cheat for my script. Weapon Detection works completely. Only Ammo Detection is not working. Here is my code for ammo detection:

PHP код:

new weaponslot GetWeaponSlotID(GetPlayerWeapon(playerid));
    new 
ammo GetPlayerAmmo(playerid);
    
        
printf("Gun :%d (%d)",GetPlayerWeapon(playerid),ammo); //For debugging
        
if(PlayerInfo[playerid][pAmmo][weaponslot] < ammo)
            print(
"Ammo Hacked");
    } 
printf will give output like this:
[code]
Gun :31(50)
Gun :31(1500) [code]

That happens after I gave myself a M4 using admin command, which is clean. I gave myself 50 ammo and use some of it to test if it doesnt detect it false. It does not. Then I go and hack the same weapon, and hack gives me 1500 ammo.

On further debugging, I found out that, upon hacking the same weapon, For eg I had a server sided M4 with 50 ammo. I than hack same gun using my hack but hack will spawn a M4 with 1500 Ammo. Now Server sets, pAmmo variable for player when they get a server sided weapon. As seen in my code above, I have checked if the current ammo in hand matches with Player's stored variable or not and actually on using printf, I can see the variable was also changed. value of PlayerInfo[playerid][pAmmo][weaponslot] was equal to 1500 and that is why it was not able to tell that it was a hack. Sure I can put if value is above 200 than he hacked it but what about hacked ammo less than that amount. Hacking of ammo even 1, should be able to catch.

Please tell me whats wrong here. Thanks.
Reply


Messages In This Thread
help with anti cheat - by GeorgeMcReary - 29.05.2018, 12:07
Re: help with anti cheat - by GeorgeMcReary - 30.05.2018, 09:08
Re: help with anti cheat - by Sew_Sumi - 30.05.2018, 11:19
Re: help with anti cheat - by GeorgeMcReary - 30.05.2018, 12:02
Re: help with anti cheat - by GeorgeMcReary - 31.05.2018, 11:25
Re: help with anti cheat - by Sew_Sumi - 31.05.2018, 12:01
Re: help with anti cheat - by CodeStyle175 - 31.05.2018, 12:54
Re: help with anti cheat - by Sew_Sumi - 31.05.2018, 13:09
Re: help with anti cheat - by DeathCore - 31.05.2018, 15:34
Re: help with anti cheat - by RogueDrifter - 31.05.2018, 16:12

Forum Jump:


Users browsing this thread: 3 Guest(s)