Anti health hack problem - 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: Anti health hack problem (
/showthread.php?tid=610047)
Anti health hack problem -
andrejc999 - 19.06.2016
So guys I made an anti health hack system and it doesn't work for some reason.
When i connect to my server I don't get my old stats from database and every command is unknown O.O
Here is the code:
Код:
new Float:newhealth[MAX_PLAYERS];
new Float:oldhealth[MAX_PLAYERS];
forward SetPlayerHealthEx(playerid, Float:hp);
forward BKACHealth();
//OnGameModeInit
SetTimer("BKACHealth", 1000, true);
public SetPlayerHealthEx(playerid, Float:hp)
{
new Float:health;
oldhealth[playerid] = GetPlayerHealth(playerid, health);
SetPlayerHealthEx(playerid, hp);
newhealth[playerid] = hp;
return 1;
}
public BKACHealth()
{
new Float:hp, msg[128];
for(new i=0;i<MAX_PLAYERS;i++)
{
GetPlayerHealth(i, hp);
if(hp > newhealth[i])
{
if(pInfo[i][pLogged] == 1 && ocitan[i] == 1)
{
KickWithMessage(i, COLOR_INFO, "Kikovani ste sa servera!Razlog:Money hack.");
format(msg, sizeof(msg), "BK|AC:Igrac %s je kikovan sa servera! Razlog:Health Hack.", GetName(i));
SCMALL(COLOR_INFO, msg);
}
}
}
return 1;
}
Can somebody help me? Thx
Re: Anti health hack problem -
MBilal - 19.06.2016
No need to make Anti HH
You can use custom damage OnPlayerGiveDamage or OnPlayerTakeDamage
Re: Anti health hack problem -
andrejc999 - 19.06.2016
Ye thx but nevermind I fixed it..