Anti-cheat help.
#1

Hello,

I have made a working Anti-Cheat system but only the money hack part is kinda bugging.

pawn Код:
new PMoney = GetPlayerMoney(i);
                if(PMoney > Player[i][Money]){
                    if(Player[i][JustBoughtNos] != 1) continue;
                    if(Player[i][JustBoughtVehicle] != 1) continue;
                    ServerBan(i, "Money Hack");
                    printf("SAMP money: %d", PMoney);
                    printf("Stats money: %d", Player[i][Money]);
                }
That is the part that checks for money in the anti-cheat.

Everytime someone buys a car or nos in the server it bans them for money hacks which is almost impossible due to this take money system:

pawn Код:
stock TakePlayerCash(playerid, value)
{
    if(playerid != INVALID_PLAYER_ID){
        GivePlayerMoney(playerid, -value);
        Player[playerid][Money] -= value;
    }
    return 1;
}
It first TAKES the money, THEN it updates the stats.

So it's impossible that it will be a ban :/

Can someone help?
Reply
#2

maybe use "return 1;" instead of "continue;" ?
Reply
#3

Thats not really the problem, the problem is that somehow the samp money is always bugger then the stats even tho the money in the stats gets updated first, then the money ig.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)