29.03.2013, 10:16
Hello, in my server the default hp/armour value is 90, so i made a health/armour anticheat. If a player has more than 91 hp, he's cheating. The problem is: Sometimes players get banned when they spawn because for 1 sec they got 100 hp (even if i set 90 hp/armour on OnPlayerSpawn). Here is the code:
How i can fix this problem? I've SetPlayerHealth/Armour(playerid,90); on OnPlayerSpawn, OnPlayerConnect, OnPlayerRequestClass/Spawn.
pawn Код:
new Float:phealth;
new Float:parmour;
GetPlayerHealth(i, phealth);
GetPlayerArmour(i, parmour);
if(phealth >=100 || parmour >=100)
{
TotalAutoBan++;
new pname[24];
new string[320];
new jj[128];
new IP[16];
GetPlayerName(i, pname, sizeof(pname));
GetPlayerIp(i, IP, 16);
format(string, sizeof(string), "** System Ban: %s (%d) has been banned for hp/armour hack (%0.2f hp - %0.2f armour)", pname,i,phealth,parmour);
format(jj,sizeof(jj),"** Total Cheaters Raped: %d",TotalAutoBan);
SCMTA(pink,string);
SCMTA(pink,jj);
SCM(i,red,"You have been banned by System for hp/armour. If you think this is a mistake, post an unban appeal at www.codsamp.net");
SCM(i,red,"Don't try to evade the ban otherwise you'll get rangebanned.");
pInfo[i][Banned] ++;
new str[64];
format(str,sizeof(str),"banip %s",IP);
SendRconCommand(str);
BanLog(string);
BanEx(i,string);
new msg[400];
format(msg, sizeof(msg), "0,4** System Ban: %s (%d) has been banned for hp/armour hack (%0.2f hp - %0.2f armour) Total Cheaters Raped: %d",pname,i,phealth,parmour,TotalAutoBan);
IRC_GroupSay(gGroupID, IRC_CHANNEL, msg);
IRC_GroupSay(gGroupID, IRC_ACHANNEL, msg);
}
}