[Help]Anti Health Hack
#1

Hi, i have 1 problem with my Anti Health Hack, i created This:
Код:
stock J_SetPlayerHealth(playerid,Float: health)
{
SetPlayerHealth(playerid,health);
new Float:vita;
GetPlayerHealth(playerid,vita);
antihealth[playerid] = vita;
return 1;
}
OnPlayerSpawn:
Код:
SetTimerEx("CheckHack",1000,1,"d",playerid);
CheckHack:
Код:
public CheckHack(playerid)
{
new Float:vita;
GetPlayerHealth(playerid,vita);
if(antihealth[playerid] > vita || antihealth[playerid] < vita)
{
new stringa[256];
format(stringa,sizeof(stringa),"AntiCheat: %s has been kicked, reason: Health Hack",GetPlayerNameEx(playerid));
SendClientMessageToAll(0xFF0000EC,stringa);
Kick(playerid);
}
return 1;
}
(I created variable "new Float:antihealth[MAX_PLAYERS]")
i tried also SetPVarFloat and kick me also if i no use Hack.
Sorry for my Bad English...
Reply
#2

Try this -> https://sampforum.blast.hk/showthread.php?tid=303695 <- its efficient if you want to use it with command!
Reply
#3

Thanks for the advice but I need a timer that starts automatically, try to change a little bit filterscript that, I will answer as soon as possible, thank you
Ps. I will maintain your rights
Reply
#4

This is no Anti Health Hack, this is Check, i need a Anti Health Hack, not Check Health Hack
Reply
#5

Try this simple code

under GameModeInit put this timer SetTimer("healthcheck", 3000, true);

forward healthcheck();

pawn Код:
public healthcheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
        {

           new Float:phealth;
           GetPlayerHealth(i, phealth);
           if(phealth >=101)
        {
            new pname[200];
            new string[200];
                GetPlayerName(i, pname, sizeof(pname));
                format(string, sizeof(string), "SERVER: %s id (%d) has been banned! Reason: Health hack", pname,i);
                SendClientMessageToAll(0xffffffff,string);
    BanEx(i,string);
         }
    }
    return 1;
}
Reply
#6

This is an Anti-God Mode, there's just something to make that automatically kick a player for Health Hack?
Reply
#7

Then try with OnPlayerTakeDamage, you must check if player has health hack there is no other way.
Reply
#8

The problem is that I have no idea how to do of OnPlayerTakeDamage...
Reply
#9

try to check the wiki for the example onplayertakedamage. cessil has best antihealth hack he made one around the scripting discussion i think try to search it
Reply
#10

I honestly know how the public, my problem is the script, I do not know where to start
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)