[HELP]I Want To Build a Anti Cheat.
#4

Quote:
Originally Posted by antonio112
Посмотреть сообщение
Well, with money anticheat ain't that hard. All you have to do, is create a new variable, in which you 'hold' the player moneys and check / add / substract / take / w/e from that variable instead of money. Let me give you an example:

pawn Код:
new pMoney[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    if(GetPlayerMoney(playerid) != pMoney[playerid])
    {
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid, pMoney[playerid]);
    }
    return 1;
}
Now, whenever you want to give or take money to / from a player, you change that variable.

pawn Код:
//GivePlayerMoney(playerid, 1000); This will become:
pMoney[playerid] += 1000;

With anti weapons cheats it's a little more complicated. You must create a new variable for each weapon slot, which you can find all about here.

After creating a variable for each slot, when you give a weapon or take one, you have to modify that specific variable. You can use the 'OnPlayerUpdate' callback to check if a player have a different weapon ID than he should have. Now, the problem is what happens when there's no ammo left in a weapon and it 'disappears'...

Also, it's not really necessary to use 'OnPlayerUpdate' callback, you can also create a new timer, which loops through all online players. You can set the timer time to 500 ms.
The idea is that OnPlayerUpdate is called pretty often (few times per second), which means at a basis of hundred players, it might lag or something.


I don't know what's 'Crasher' supposed to mean.

About bots, I don't know what exactly you're reffering to.
but i want to build a O_GivePlayerMoney
and i have this stock
stock O_GivePlayerMoney(playerid,money)
{
statick Omoney;
GivePlayerMoney(playerid,money);
return Omoney;
}
this good ? or not ?
Reply


Messages In This Thread
[HELP]I Want To Build a Anti Cheat. - by ofekw2 - 31.01.2013, 04:25
Re: [HELP]I Want To Build a Anti Cheat. - by antonio112 - 31.01.2013, 06:51
Re: [HELP]I Want To Build a Anti Cheat. - by Threshold - 31.01.2013, 07:17
Re: [HELP]I Want To Build a Anti Cheat. - by ofekw2 - 31.01.2013, 11:26

Forum Jump:


Users browsing this thread: 1 Guest(s)