Little bug with anti money hack
#7

Just use a timer to update the client's money every second by the value stored on the server.

When you give a player some money, use something like this:
pawn Код:
GivePlayerMoneyEx(playerid, amount)
{
    Money[playerid] = Money[playerid] + amount;
}
Somewhere in your script:
pawn Код:
// This timer runs every second
forward GlobalTimer1000();
public GlobalTimer1000()
{
    // Loop through all players and only run the timer for each player who's connected
    for (new playerid; playerid < MAX_PLAYERS; playerid++)
        if (IsPlayerConnected(playerid) == 1)
        {
            ResetPlayerMoney(playerid);
            GivePlayerMoney(playerid, Money[playerid]);
        }
}
OnGameModeInit:
pawn Код:
SetTimer("GlobalTimer1000", 1000, true);
Then this timer will run for all players.

Even when a hacker hacks his client to display $1000000 and freeze the value, it won't do him any good.
This timer overwrites his money displayed onscreen.
Even if they manage to freeze it permanently, use the value stored on the server to buy everything in your script.

If the server holds $100, while they have hacked their client to display $1000000, they won't be able to buy anything more expensive than $100 as the server knows he has only $100.

Then it doesn't matter if they hack money, and you don't need to ban them either.
And there is no need to use GetPlayerMoney anywhere in your script to even check if they're hacking.

The only thing they would be able to buy with hacked money, is a soda can out of the drinking machines.
And that alone won't ruin your server.
Reply


Messages In This Thread
Little bug with anti money hack - by Glossy42O - 03.02.2015, 11:02
Re: Little bug with anti money hack - by OstGot - 03.02.2015, 11:13
Re: Little bug with anti money hack - by OstGot - 03.02.2015, 11:17
Re: Little bug with anti money hack - by Kruno88 - 03.02.2015, 11:21
Re: Little bug with anti money hack - by Glossy42O - 03.02.2015, 15:24
Re: Little bug with anti money hack - by BroZeus - 03.02.2015, 15:30
Re: Little bug with anti money hack - by PowerPC603 - 03.02.2015, 15:43
Re: Little bug with anti money hack - by Glossy42O - 03.02.2015, 16:21
Re: Little bug with anti money hack - by Glossy42O - 04.02.2015, 13:50
Re: Little bug with anti money hack - by CalvinC - 04.02.2015, 15:38

Forum Jump:


Users browsing this thread: 1 Guest(s)