PDA

View Full Version : SetPlayerHealth with anticheat


TwinkiDaBoss
16/06/2016, 12:08 AM
Alright so I will not name the cheat but you all know the story. Its the one that starts with S ends with IT

So since SetPlayerHealth doesnt get called by the anti cheat and shit, detecting by simply checking

new Float:Hp;
GetPlayerHealth(playerid,HP);

if(HP > some custom HP etc.) return BanPlayer...

wont work.

SetPlayerHealth like doesnt get called and shit in it, so is there any way to prevent it other way around? I tried looking at some tutorials and some discussions that there were, but cant find anything decent enough,

Gammix
16/06/2016, 12:14 AM
GetPlayerHealth returns the health player has, no matter if received with cheats or given by server. And health hacks don't work like that, the health can be a constant value, never changing, so the health never gets increased and your check fails.

There is a anti health hack here (http://forum.sa-mp.com/showthread.php?t=594848), maybe some help.

TwinkiDaBoss
16/06/2016, 12:34 AM
Yeah I understand you but for example this

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) {
new ss[128];
format(ss,sizeof(ss),"%s got hit by %s",GetName(playerid),GetName(issuerid));
SendClientMessageToAll(COLOR_RED,ss);
return true;
}

He turns on the cheat - nothing gets detected
he turns off the cheat - everything gets detected

Gammix
16/06/2016, 01:03 AM
Yeah I understand you but for example this

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) {
new ss[128];
format(ss,sizeof(ss),"%s got hit by %s",GetName(playerid),GetName(issuerid));
SendClientMessageToAll(COLOR_RED,ss);
return true;
}

He turns on the cheat - nothing gets detected
he turns off the cheat - everything gets detected

OnPlayerGiveDamage is what you should be using.

TwinkiDaBoss
16/06/2016, 01:04 AM
OnPlayerGiveDamage is what you should be using.

Just tested, same bro :/

ALTHO I finally found a way with
OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)

For some reason neither does OnPlayerGiveDamage or Take doesnt get detected with this version of the cheat, only OnplayerWeaponShot does

Gammix
16/06/2016, 02:09 AM
Just tested, same bro :/

ALTHO I finally found a way with
OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)

For some reason neither does OnPlayerGiveDamage or Take doesnt get detected with this version of the cheat, only OnplayerWeaponShot does

OnPlayerGiveDamage on the shooter side ?