20.12.2012, 20:00
hello guys. i made my own anti cheat 'health' the problem is its not detecting or kicking me.
Code:
i made a new callback public HackCheck() and i got a timer
but the anti-hack doesn't work. i dont know if i my coding is right. or? can anyone help me please?
Code:
pawn Код:
public HackCheck()
{
new
Float:pHealth,
Float:pArmour,
Float:vHealth,
string[128];
for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid))
{
GetPlayerHealth(playerid, pHealth);
GetPlayerArmour(playerid, pArmour);
/*if(AdminLevel[playerid] >= 1) //Do not kick a admin
{
return 1;
}*/
if(pHealth >= 100.1)
{
SendClientMessage(playerid, COLOR_RED,"You Have Been Auto Kick For Using Health Hack");
format(string, sizeof(string), "%s(%d) Has been Auto-Kicked for using Health Hack", GetName(playerid), playerid);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
}
if(pArmour >= 100.1)
{
SendClientMessage(playerid, COLOR_RED,"You Have Been Auto Kick For Using Armour Hack");
format(string, sizeof(string), "%s(%d) Has been Auto-Kicked for using Armour Hack", GetName(playerid), playerid);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
}
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleHealth(GetPlayerVehicleID(playerid), vHealth);
if(vHealth >= 1000.1)
{
SendClientMessage(playerid, COLOR_RED,"You Have Been Auto Kick For Using Vehicle Health Hack");
format(string, sizeof(string), "%s(%d) Has been Auto-Kicked for using Vehicle Health Hack", GetName(playerid), playerid);
SendClientMessageToAll(COLOR_RED, string);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
Kick(playerid);
}
}
}
return 1;
}
return 1;
}
Код:
SetTimer("HackCheck",3000,1);