19.01.2014, 15:37
Quote:
I believe Health Hack can be easily detected starting in 0.3z because there is a new callback called OnPlayerWeaponShot, I am not sure if my code will work it is un-tested but I know you can detect Health Hack using OnPlayerWeaponShot
pawn Code:
|
It would be like this:
pawn Code:
static stock
AC_StartHPTick[ MAX_PLAYERS ];
#define MAX_HPWARNING (3)
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_PLAYER)
{
new
string[ 90 ], name[ MAX_PLAYER_NAME ], Float:Health, Float:Armour;
GetPlayerArmour(hitid, Armour), GetPlayerHealth(hitid, Health), GetPlayerName(hitid, name, MAX_PLAYER_NAME);
if(Health >= 99.0 && Armour <= 0.0)
{
++ AC_StartHPTick[ playerid ];
}
else if(AC_StartHPTick[ playerid ] >= MAX_HPWARNING)
{
format(string, sizeof(string), "[ANTI-CHEAT] - %s[%d] is POSSIBLY using Health-Hacks!", name, playerid);
SendClientMessageToAll(-1, string);
}
else
{
AC_StartHPTick[ playerid ] = 0;
}
}
return true;
}
About anti-cheat:
You really need to read cessil's thread about making a successful anti-cheat. The way you made it, if somebody uses a vending machine 3 times, it will get him banned. You need to take care of every possible way someone can get healed on your server means, you need to make completely server side health system such as make custom shops, remove vending machines and a lot more.