29.07.2011, 19:41
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
forward Hacking();
public OnPlayerUpdate(playerid)
{
new Float:fHealth;
GetPlayerHealth(playerid, fHealth);
if(fHealth != GetPVarFloat(playerid, "faPlayerHealth"))
{
// Player health has changed since the last update -> server, so obviously thats the thing updated.
// Lets do further checks see if he's lost or gained health, anti-health cheat? ;)
if(fHealth > GetPVarFloat(playerid, "faPlayerHealth"))
{
SetTimer("Hacking", 2000, false);
SendClientMessageToAll(0xDEEE20FF, "TEST");
}
else
{
/* He has lost health! */
}
SetPVarFloat(playerid, "faPlayerHealth", fHealth);
}
}
If you wanna join me read my signature.