SA-MP Forums Archive
SetPlayerHealth with anticheat - 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: SetPlayerHealth with anticheat (/showthread.php?tid=609726)



SetPlayerHealth with anticheat - TwinkiDaBoss - 16.06.2016

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

PHP Code:
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,


Re: SetPlayerHealth with anticheat - Gammix - 16.06.2016

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, maybe some help.


Re: SetPlayerHealth with anticheat - TwinkiDaBoss - 16.06.2016

Yeah I understand you but for example this

PHP Code:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart) {
    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


Re: SetPlayerHealth with anticheat - Gammix - 16.06.2016

Quote:
Originally Posted by TwinkiDaBoss
View Post
Yeah I understand you but for example this

PHP Code:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart) {
    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.


Re: SetPlayerHealth with anticheat - TwinkiDaBoss - 16.06.2016

Quote:
Originally Posted by Gammix
View Post
OnPlayerGiveDamage is what you should be using.
Just tested, same bro :/

ALTHO I finally found a way with
PHP Code:
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ
For some reason neither does OnPlayerGiveDamage or Take doesnt get detected with this version of the cheat, only OnplayerWeaponShot does


Re: SetPlayerHealth with anticheat - Gammix - 16.06.2016

Quote:
Originally Posted by TwinkiDaBoss
View Post
Just tested, same bro :/

ALTHO I finally found a way with
PHP Code:
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat: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 ?