Hello Need small help Pros - 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: Hello Need small help Pros (
/showthread.php?tid=593330)
Hello Need small help Pros -
MBilal - 04.11.2015
Код:
#if defined _ALS_SetPlayerHealth
#undef SetPlayerHealth
#else
#define _ALS_SetPlayerHealth
#endif
#define SetPlayerHealth SetPlayerHealthEx
SetPlayerHealthEx(playerid,Float:NewHealth)
{
PlayerHealth[playerid] = NewHealth;
SetPlayerHealth(playerid , NewHealth) ;
return CheckHack(playerid);
}
CheckHack(playerid)
{
new Float:Health;
GetPlayerHealth(playerid, Health);
if(Health > PlayerHealth[playerid])return KickMessages(playerid, "Health Hack");
return 1;
}
I am working on this .. is this can detect health hack i dont want to use timer..
Kindly help thanks.
Re: Hello Need small help Pros -
IceBilizard - 04.11.2015
If you don't want to use timer then probably use it on OnPlayerUpdate example
pawn Код:
public OnPlayerUpdate(playerid)
{
CheckHack(playerid);
return 1;
}
Re: Hello Need small help Pros -
Karan007 - 04.11.2015
You SHOULD use a timer or add this function in the callback OnPlayerUpdate. Because the script you just made is just a function and so, it won't check anything.
Re: Hello Need small help Pros -
MBilal - 04.11.2015
Thanks I wil try it out.
Re: Hello Need small help Pros -
Karan007 - 04.11.2015
Quote:
Originally Posted by MBilal
Thanks I wil try it out.
|
No problem. Anytime
Re: Hello Need small help Pros -
MBilal - 04.11.2015
Код:
new Float:Health;
GetPlayerHealth(playerid, Health);
if(Health > PlayerHealth[playerid])return KickMessages(playerid, "Health Hack");
I put this under global timer checking all player health after 1 sec
the problem is it kicking innocent . . . like when some budy buy health it
some time take Time ReFix PlayerHealth[playerid]
and timer called before it.. so player got kicked...