SA-MP Forums Archive
Anti-cheat help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti-cheat help. (/showthread.php?tid=533380)



Anti-cheat help. - Stefand - 24.08.2014

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?


Re: Anti-cheat help. - AiRaLoKa - 24.08.2014

maybe use "return 1;" instead of "continue;" ?


Re: Anti-cheat help. - Stefand - 24.08.2014

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.