Need Small help Rep + - 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: Need Small help Rep + (
/showthread.php?tid=564885)
Need Small help Rep + -
MBilal - 23.02.2015
I'm trying to make anti cheat ,
Code:
OnPlayerTakeDamage
under
if(Armour==0)
{
HH[playerid]++;
switch(HH[playerid])
{
case 1:
{
new Float:OldHealth[playerid];
GetPlayerhealth(playerid,OldHealth[playerid]);
}
case 2:
{
new Float:newHealth[playerid];
GetPlayerhealth(playerid,newHealth[playerid]);
}
case 3:
{
if(OldHealth[playerid]== newHealth[playerid])
{
//hacking ..
}
}
}
}
I'm trying to detect health hack under OnPlayerDamage
Is i am doing right?
Re: Need Small help Rep + -
Antoniohl - 23.02.2015
you're in the right place "OnPlayerTakeDamage"
Re: Need Small help Rep + -
marshallbrown - 23.02.2015
Yep. Reply up if you got any errors.
Re: Need Small help Rep + -
MBilal - 23.02.2015
I convert code to this check this out?
Code:
new Float:AR[MAX_PLAYERS];
new HH[MAX_PLAYERS] ; new Float:OldHealth[MAX_PLAYERS];new Float:newHealth[MAX_PLAYERS];
GetPlayerArmour(playerid,AR[playerid]);
if(AR[playerid]==0)
{
HH[playerid]++;
if(HH[playerid]==1)
{
GetPlayerHealth(playerid,OldHealth[playerid]);
}
else if(HH[playerid]==2)
{
GetPlayerHealth(playerid,newHealth[playerid]);
}
else if(HH[playerid]==4)
{
if(OldHealth[playerid]== newHealth[playerid])
{
SCM(playerid,red,"Warning:Stop hacking.");
Kick(playerid);
}
}
}