30.03.2013, 19:31
So I've decided to try something new. I'm attempting to create a very basic anti-cheat.
Note: The armour one works fine, but the health one doesn't. I set my health to 200 in-game and don't get kicked.
Here's the code.
Would you guys recommend something like this?
Note: The armour one works fine, but the health one doesn't. I set my health to 200 in-game and don't get kicked.
Here's the code.
pawn Code:
public OnPlayerUpdate(playerid)
{
new Float:hp;
hp = GetPlayerHealth(playerid, hp);
if(hp > 150 )
{
new string[128];
format(string,sizeof(string), "[Urban Gaming] %s has been kicked for the following Hack. (Healh Hacks)");
SendClientMessageToAll(COLOR_BRIGHTRED, string);
Kick(playerid);
}
new Float:arm;
hp = GetPlayerArmour(playerid, arm);
if(arm > 150 )
{
new string[128];
format(string,sizeof(string), "[Urban Gaming] %s has been kicked for the following Hack. (Armour Hacks)");
SendClientMessageToAll(COLOR_BRIGHTRED, string);
Kick(playerid);
}
return 1;
}