Money Ac
#1

PHP Code:
GiveMoney(playeridamount)
{
    
pInfo[playerid][pMoney] += amount;
    
GivePlayerMoney(playeridamount);
    return 
1;

is this enough for money anticheat or I have to add something more? Because I can't find a right anticheat everyone makes it different so I'm confused.. I just made my own and I was wondering if I miss something.
Reply
#2

Well, im doing little bit different. Im using kinda same method that everyone else use.

pawn Code:
/* Money defines */
#define GivePlayerCash(%0,%1)                                       SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
#define ResetPlayerCash(%0)                                         SetPVarInt(%0,"Money",0), ResetPlayerMoney(%0)
#define GetPlayerCash(%0)                                           GetPVarInt(%0,"Money")


public OnPlayerUpdate(playerid) {
    if(GetPlayerCash(playerid) < GetPlayerMoney(playerid)) {
        foreach(Player, i) {
            new const old_money = GetPlayerCash(playerid);
            ResetPlayerCash(playerid), GivePlayerCash(playerid, old_money);
        }
    }
    return 1;
}
If i want to add or remove or give player cash then i use only one thing.

pawn Code:
if player spawn:GivePlayerCash(playerid, playerVariables[playerid][pCash]);
If he buy something: GivePlayerCash(playerid,-500);
If he get money: GivePlayerCash(playerid, 500);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)