SA-MP Forums Archive
health anti cheat problem(code) - 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: health anti cheat problem(code) (/showthread.php?tid=321746)



health anti cheat problem(code) - peterory - 28.02.2012

i get the oldhp1 but it would be more than 214597 ← why will that?
and it didn't return send clientmessage it just will show you once and you fight the target again
it not will send message to you
and i want if oldhp1 = newhp1 the server will kick the player
can some one help me to edit this anti cheat?


Код:
new fzb[MAX_PLAYERS];
new string2[128];
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
new Float:oldhp1;
new Float:newhp1;
if(issuerid != INVALID_PLAYER_ID)
{
if(fzb[playerid] == 0)
{
GetPlayerHealth(playerid,oldhp1);
format(string2, sizeof(string2), "he have %d HP",oldhp1);
SendClientMessage(issuerid,COLOR_YELLOW, string2);
fzb[playerid] = 1;
return 1;
}
if(fzb[playerid] == 1)
{
GetPlayerHealth(playerid,newhp1);
fzb[playerid] = 0;
}
else if(oldhp1 == newhp1)
{
GameTextForPlayer(playerid, "You Are Cheater", 3000, 3);
GameTextForPlayer(issuerid, "He Is Cheater", 3000, 3);
return 1;
}
return 1;
}
return 1;
}



Re: health anti cheat problem(code) - Deathlane - 28.02.2012

I am not sure... but try removing the "return 1;" on "else if(oldhp1 == newhp1)" (I am not very sure)