SA-MP Forums Archive
Money anti-cheat problem. [REP+] - 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: Money anti-cheat problem. [REP+] (/showthread.php?tid=293477)



Money anti-cheat problem. [REP+] - GangsTa_ - 28.10.2011

Trying to make a money anticheat.

pawn Код:
public GetMoney()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new money = GetPlayerMoney(i);
            if(PlayerInfo[i][pCash] > money) // if the server money are more than the server given money
            {
                ResetPlayerMoney(i);
                GivePlayerMoney(i, PlayerInfo[i][pCash]);
            }
            else if(PlayerInfo[i][pCash] < money) // if the game money are lower than the server-given money
            {
                ResetPlayerMoney(i);
                GivePlayerMoney(i, PlayerInfo[i][pCash]);
            }
        }
    }
    return ;
}
But in-game the cash variable exists, but the money doesn't show in the hud.
Any ideas?


Re: Money anti-cheat problem. [REP+] - [MWR]Blood - 28.10.2011

Quote:
Originally Posted by GangsTa_
Посмотреть сообщение
But in-game the cash variable exists, but the money doesn't show in the hud.
Didn't make any sense for me, what are you trying to say?!


Re: Money anti-cheat problem. [REP+] - GangsTa_ - 28.10.2011

Umm, well, to make you understand...
Actually let's say in a 24/7 I can buy whatever I want with the money from the [pCash] variable. But when I use /givemoney or whatever to increase the money - it just doesn't appear on the hud... Keeps being '0'


Re: Money anti-cheat problem. [REP+] - [MWR]Blood - 28.10.2011

Oh well, you could simply say that it's not giving you any money.
However, show the places where you are using the GetPlayerMoney function you created.
Also, did you forget to put a return size?
Quote:

return ;

pawn Код:
return 1;



Re: Money anti-cheat problem. [REP+] - GangsTa_ - 28.10.2011

Fk I just forgot to add the timer for checking if a player hacks...
Damn, nevermind. Anyways thanks, rep+