13.05.2012, 23:23
It's pretty easy to make.
Whipped this up in ~1 minute.
pawn Код:
//Anti-Cheat Info
new AntiCheatTimer;
enum _ACInfo
{
Float:Health, Float:Armour, Money,
}
new ACInfo[MAX_PLAYERS][_ACInfo];
#define GivePlayerMoney GivePlayerMoneyEx
#define SetPlayerHealth SetPlayerHealthEx
#define SetPlayerArmour SetPlayerArmourEx
public OnGameModeInit()
{
AntiCheatTimer = SetTimer("AntiCheat",1000,true);
}
public OnGameModeExit()
{
KillTimer(AntiCheatTimer);
}
forward AntiCheat();
public AntiCheat()
{
new Float:HP,Float:AP,_Money=GetPlayerMoney(playerid);
GetPlayerHealth(playerid,HP);
GetPlayerArmour(playerid,AP);
if(HP > ACInfo[playerid][Health])
{
//Gained health, he used cheats
}
else
{
ACInfo[playerid][Health] = HP; //If he lost health, set anti-cheat info health to current health
}
if(AP > ACInfo[playerid][Armour])
{
//Gained armour, he used cheats
}
else
{
ACInfo[playerid][Health] = HP; //If he lost armour, set anti-cheat info armour to current armour
}
if(_Money > ACInfo[playerid][Money])
{
//Gained health, he used hacks
}
else
{
ACInfo[playerid][Money] = _Money; //If he lost money, set anti-cheat info money to current money
}
return 1;
}
stock SetPlayerHealthEx(playerid, Float:HP)
{
SetPlayerHealth(playerid, HP);
ACInfo[playerid][Health] = HP;
return 1;
}
stock SetPlayerArmourEx(playerid, Float:AP)
{
SetPlayerArmour(playerid, AP);
ACInfo[playerid][Armour] = AP;
return 1;
}
stock GivePlayerMoneyEx(playerid, money)
{
GivePlayerMoney(playerid, money);
ACInfo[playerid][Money] += money;
return 1;
}