anti ammo cheat
#1

Hi, I made this ammo anti cheat
Код:
//OnPlayerWeaponShot...
new ammo = GetPlayerAmmo(playerid) - 1, slot = GetWeaponSlot(weaponid);

if (ammo >= PlayerInfo[playerid][pAmmo][slot])
{
	//player is cheating ammo
}
else PlayerInfo[playerid][pAmmo][slot] = ammo;
and it works perfectly for all guns except MP5 because it's too fast. Does anyone have an idea how to make it work for MP5? I'd really appreciate it.
Reply
#2

Код:
PlayerInfo[playerid][pAmmo][slot] = ammo + 2
In my point of view, this way it'd reduce the false-positives as it gives chance to the server to update the player's ammo.
Reply
#3

It's not going to work because it always sets the new ammo to current ammo - 1 in the variable so for example if a weapon has 100 ammo, you shoot once, the new ammo is supposed to be 100 - 1 = 99, and you set the variable to 99 + 2 = 101, but your ammo is still 100 and when you shoot again the same thing happens: 100 - 1 = 99, variable is set to 99 + 2 = 101 and it will never get detected.
Reply
#4

I don't know how the ammo cheat works, but doesn't it increase the ammo? Or perhaps it stops the ammo usage?
Reply
#5

This one will detect infinite ammo and adding ammo. By the way what I did as a solution was create a variable with player's ammo cheat warnings and now every time it detects ammo cheat, it increments the warnings by 1, else if it doesn't detect ammo cheat it decrements the warnings by 1 if there are any, if 3 warnings are reached I ban the player. Seems to be working perfectly.
Reply
#6

I believe that the ammo detection doesn't work as expected and, you can also try checking the player ammo if it's 65535 or -65535, he/ she is hacking.
Reply
#7

Quote:
Originally Posted by Logic_
Посмотреть сообщение
I believe that the ammo detection doesn't work as expected and, you can also try checking the player ammo if it's 65535 or -65535, he/ she is hacking.
It is working perfectly. :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)