23.02.2011, 22:38
I failed on a Anti Health Hack here =/
This bans you when you Loose health.
Soo, How to fix![Smiley](images/smilies/smile.png)
This bans you when you Loose health.
Soo, How to fix
![Smiley](images/smilies/smile.png)
pawn Код:
#include <a_samp>
#include <foreach>
forward AntiHealthHack();
new Float:pHealth[MAX_PLAYERS];
public OnFilterScriptInit()
{
SetTimer("AntiHealthHack", 1000, true);
return 1;
}
public OnPlayerConnect(playerid)
{
pHealth[playerid] = 100;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
pHealth[playerid] = 100;
return 1;
}
public AntiHealthHack()
{
foreach(Player, i)
{
new Float:Health;
GetPlayerHealth(i, Health);
if(Health != pHealth[i] && Health > 0)
{
if(Health < pHealth[i])
{
pHealth[i] = Health;
BanEx(i, "Health Hacker");
}
else
{
SetPlayerHealth(i, pHealth[i]);
return 1;
}
}
}
return 1;
}