[Include] [INC] Money Anticheat
#1

90% античитов на деньги обходятся по такой схеме. В этом античите такое не пройдёт.

Инсталляция:

Difference - это отличие между суммой, которую игроку дало скриптом и которая у него на руках. Если эта сумма отличается более чем на 15$ его кикнет. Для стант-серверов рекомендуется сделать побольше, но в пределах нормы.

Ставим в TOP
pawn Code:
#define DIFFERENCE 15
new PlayerMoney[MAX_PLAYERS];
Ставим отдельно:
pawn Code:
//-----------------------------------------------------------------------------------------------------

public OnPlayerConnect(playerid)
{
PlayerMoney[playerid] = 0;
return 1;
}

//-----------------------------------------------------------------------------------------------------

stock GivePlayerMoneyUAC(playerid,money)
{
MoneyAntiCheat(playerid);
PlayerMoney[playerid]+=money;
GivePlayerMoney(playerid,money);
return 1;
}

//-----------------------------------------------------------------------------------------------------

stock SetPlayerMoneyUAC(playerid,money)
{
MoneyAntiCheat(playerid);
PlayerMoney[playerid] = money;
SetPlayerMoney(playerid,money);
return 1;
}

//-----------------------------------------------------------------------------------------------------

stock GetPlayerMoneyUAC(playerid)
{
MoneyAntiCheat(playerid);
return PlayerWant[playerid][playermoneyuac];
}


//-----------------------------------------------------------------------------------------------------

stock ResetPlayerMoneyUAC(playerid)
{
MoneyAntiCheat(playerid);
PlayerMoney[playerid] = 0;
ResetPlayerMoney(playerid);
return 1;
}

//-----------------------------------------------------------------------------------------------------

forward MoneyAntiCheat(playerid);
public MoneyAntiCheat(playerid)
{
new string[128];
new cash = GetPlayerMoney(playerid);
if(cash > playermoneyuac[playerid])
{
if ((cash-playermoneyuac[playerid]) > DIFFERENCE)
{
new hacked = cash - playermoneyuac[playerid];
GivePlayerMoney(playerid, -hacked);
format(string,128, "%s (%d) кикнут с сервера. Причина: Читерство на деньги (%d),GetName(playerid),playerid,hacked);
SendClientMessageToAll(COLOR_RED,string);
Kick(playerid);
}
}
return 1;
}


//-----------------------------------------------------------------------------------------------------

stock GetName(playerid)
{
new Name[256];
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
return Name;
}

//-----------------------------------------------------------------------------------------------------

stock MoneyLove(playerid)
{
new cash = GetPlayerMoney(playerid);
if(cash > playermoneyuac[playerid])
{
if ((cash-playermoneyuac[playerid]) > DIFFERENCE)
{
playermoneyuac[playerid] = GetPlayerMoney(playerid);
}else{
MoneyAntiCheat(playerid);
}
}
return 1;
}

//-----------------------------------------------------------------------------------------------------

public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
if(GetVehicleModel(vehicleid) == 420 || GetVehicleModel(vehicleid) == 438)
{
MoneyLove(playerid);
}
return 1;
}


//-----------------------------------------------------------------------------------------------------
Не забудьте заменить функции GetPlayerMoney GivePlayerMoney SetPlayerMoney на мои!
Reply


Messages In This Thread
[INC] Money Anticheat - by ^Woozie^ - 03.01.2010, 10:32
Re: [INC] Money Anticheat - by MX_Master - 03.01.2010, 11:14
Re: [INC] Money Anticheat - by [Saint] - 03.01.2010, 11:16
Re: [INC] Money Anticheat - by MX_Master - 03.01.2010, 12:43
Re: [INC] Money Anticheat - by ^Woozie^ - 03.01.2010, 14:28
Re: [INC] Money Anticheat - by Zeex - 03.01.2010, 15:11
Re: [INC] Money Anticheat - by MX_Master - 03.01.2010, 16:48
Re: [INC] Money Anticheat - by Serafim_sd - 03.01.2010, 18:02
Re: [INC] Money Anticheat - by Serafim_sd - 03.01.2010, 18:06
Re: [INC] Money Anticheat - by Zeex - 03.01.2010, 18:28
Re: [INC] Money Anticheat - by ^Woozie^ - 03.01.2010, 18:42
Re: [INC] Money Anticheat - by CrunkBankS - 13.01.2010, 18:38
Re: [INC] Money Anticheat - by ^Woozie^ - 13.01.2010, 19:58
Re: [INC] Money Anticheat - by CrunkBankS - 14.01.2010, 04:53
Re: [INC] Money Anticheat - by ^Woozie^ - 14.01.2010, 11:11
Re: [INC] Money Anticheat - by noobik - 21.01.2010, 17:37
Re: [INC] Money Anticheat - by CrunkBankS - 22.01.2010, 10:33
Re: [INC] Money Anticheat - by ^Woozie^ - 22.01.2010, 15:53
Re: [INC] Money Anticheat - by CrunkBankS - 22.01.2010, 18:29
Re: [INC] Money Anticheat - by ZiGGi - 23.01.2010, 11:34
Re: [INC] Money Anticheat - by Toney - 23.01.2010, 19:54
Re: [INC] Money Anticheat - by CrunkBankS - 24.01.2010, 07:27
Re: [INC] Money Anticheat - by ZiGGi - 30.01.2010, 11:33
Re: [INC] Money Anticheat - by [Saint] - 30.01.2010, 11:49
Re: [INC] Money Anticheat - by ZiGGi - 30.01.2010, 13:01
Re: [INC] Money Anticheat - by Riaz - 30.01.2010, 15:39
Re: [INC] Money Anticheat - by kAND - 30.01.2010, 16:13
Re: [INC] Money Anticheat - by CrunkBankS - 30.01.2010, 17:04
Re: [INC] Money Anticheat - by kAND - 30.01.2010, 17:23
Re: [INC] Money Anticheat - by CrunkBankS - 30.01.2010, 18:48
Re: [INC] Money Anticheat - by lost13 - 13.05.2010, 17:43

Forum Jump:


Users browsing this thread: 4 Guest(s)