2 posts in this topic

Доброго времени суток уважаемые пользователи pawno-rus решил выложить свою работу античита может кому пригодится. И так давайте начнем!
Ко всем new 

Спойлер

new ChekMoneyAntiCheat[MAX_PLAYERS];

В конце мода:

Спойлер

GiveMoney(playerid,money)//Выдаем деньги
{
    PlayerInfo[playerid][pMoney] += money;
    GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]-GetPlayerMoney(playerid));
}
GetMoney(playerid)//Узнаем деньги
{
    return PlayerInfo[playerid][pMoney];
}
ResetMoney(playerid)//Забираем деньги 
{
    PlayerInfo[playerid][pMoney] = 0;
    ResetPlayerMoney(playerid);
}

В public OnPlayerConnect:
 

Спойлер

PlayerInfo[playerid][pMoney] = 0;

ChekMoney[playerid] = SetTimer("ChekMoneyAntiCheat",1000,1);

Теперь создаем таймер:

Спойлер

ChekMoneyAntiCheat(playerid)//Таймер проверки
{
    GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]-GetPlayerMoney(playerid));
    if(GetPlayerMoney(playerid) != PlayerInfo[playerid][pMoney])
    {
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]);
    }
    else
    {
        PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
    }
    return 1;
}

Теперь заменяем все GivePlayerMoney,GetPlayerMoney,ResetPlayerMoney на GiveMoney,GetMoney,ResetMoney
ВАЖНО!
Здесь мы не чего не заменяем!

Спойлер

GiveMoney(playerid,money)//Выдаем деньги
{
    PlayerInfo[playerid][pMoney] += money;
    GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]-GetPlayerMoney(playerid));
}
GetMoney(playerid)//Узнаем деньги
{
    return PlayerInfo[playerid][pMoney];
}
ResetMoney(playerid)//Забираем деньги 
{
    PlayerInfo[playerid][pMoney] = 0;
    ResetPlayerMoney(playerid);
}

 

Share this post


Link to post
Share on other sites

Вот моя версия анти чита 

В конец мода:

stock hak_GivePlayerMoney(playerid, money, statis = 0)
{
	if(statis == 1) return GivePlayerMoney(playerid, money);
	if(money < 0) PlayerInfo[playerid][pMoney] = money;
	else if(money > 0) PlayerInfo[playerid][pMoney] += money;
	ResetPlayerMoney(playerid);
	return GivePlayerMoney(playerid, money);
}
#if defined _ALS_GivePlayerMoney
	#undef GivePlayerMoney
#else
	#define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney hak_GivePlayerMoney 

и в OnPlayerUpDate

if(IsPlayerConnected(playerid))
{
    if(PlayerInfo[playerid][pMoney] != GetPlayerMoney(playerid))
    {
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney], 1);
    }
}

Переменную PlayerInfo[playerid][pMoney] меняйте на свою

P.S На работу способность не проверял, но должно работать 

Edited by MuhammadPawn

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   You have pasted content with formatting.   Remove formatting

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Zaire
      By Zaire
      CMD:ban(playerid, params[]) { if(!PlayerInfo[playerid][pLogged]) return true; if(PlayerInfo[playerid][pAdmin] < 3 || AdminLogged[playerid] == false) return true; if(sscanf(params, "uis[64]", params[0], params[1], params[2])) return SendClientMessage(playerid, COLOR_GREY, "Èñïîëüçîâàíèå: /ban [id/íèê èãðîêà] [êîë-âî äíåé] [ïðè÷èíà]"); if(!IsPlayerConnected(params[0]) || params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, ""TPLAYEROFFLINE""); if(!PlayerInfo[params[0]][pLogged]) return SendClientMessage(playerid, COLOR_GREY, ""TPLAYERNLOGGED""); if(PlayerInfo[params[0]][pDebugUser]) return SendClientMessage(playerid, COLOR_GREY, ""TPLAYEROFFLINE""); if(PlayerInfo[params[0]][pAdmin] >= 1339) return SendClientMessage(playerid, COLOR_GREY, "Ýòîò èãðîê Îñíîâàòåëü! Åãî íå âîçìîæíî çàáëîêèðîâàòü!"); if(params[1] > 365 && params[1] != -1 || params[1] < 1 && params[1] != -1 ) return SendClientMessage(playerid, COLOR_GREY, "Êîë-âî äíåé îò 1 äî 365!"); if(params[1] == -1 && PlayerInfo[playerid][pAdmin] < 1339) return SendClientMessage(playerid, COLOR_GREY, "Âû íå ìîæåòå çàáëîêèðîâàòü èãðîêà íàâñåãäà!"); if(!AddPlayerBan(params[0], playerid, params[1], params[2])) {  
    • sawe123
      By sawe123
      Есть ли какая то система видел в моде что можно настраивать вес авто ищу такую систему.