Quote:
Originally Posted by Dragony92
I made this in a hurry... Should be useful....
http://pastebin.com/PNYK4JL8
pawn Code:
#include <YSI\y_timers> #include <foreach>
new PlayerHealth[MAX_PLAYERS]; new Spawned[MAX_PLAYERS] = 1;
public OnPlayerConnect(playerid) { Spawned[playerid] = 0; PlayerHealth[playerid] = 0; return 1; }
public OnPlayerSpawn(playerid) { new Float:Health; GetPlayerHealth(playerid, Health); PlayerHealth[playerid] = Health; Spawned[playerid] = 1; return 1; }
public OnPlayerDeath(playerid, killerid, reason) { Spawned[playerid] = 0; return 1; }
Timer:CheckHP[5000]() { foreach(Player, i) { if(Spawned[i] == 1) { new Float:Health, string[58 + MAX_PLAYER_NAME]; GetPlayerHealth(i, Health); if(Health > PlayerHealth[i]) { Kick(i); format(string, sizeof(string),"Player %d has been kicked by AntiCheat. Reason: HealthHack"); SendClientMessage(playerid, -1, string); } else { PlayerHealth[i] = Health; } } } return 1; }
forward ACSetPlayerHealth(playerid, Float:health) public ACSetPlayerHealth(playerid, Float:health) //Use this to SetPlayerHealth { PlayerHealth[playerid] = health; SetPlayerHealth(playerid, health); return 1; }
DraGoN's AntiCheat http://www.youtube.com/watch?v=PxDfGKDFtcg
|
Hey man this is good (didnt test it just read the code) but if a person tries to make it as a filterscript it has a BIG bug you didnt do #include <a_samp>