OnPlayerUpdate MoneyAnticheat
#1

Hello x)
I have created Money Anticheat and it works perfectly. But I am not sure if it can be better. So I used variable Player[MAX_PLAYERS][Money] with GetPlayerMoney and i put it under OnPlayerUpdate. My question is: Can this system cause laggs on server? For example: 70 players on server and it checks nonstop Has player more money than he should have.
Reply
#2

Which callback you used?

NOTE: as you can see the are a lot systems that check each sec for ex. counting online time, mute system, jail system I don't know if you are using them but for me all that systems didn't cause any lag
Reply
#3

I use only systems that I make. So, Every time player buys something or someone gives him money or whatever it sets his Player[playerid][money] variable on GetPlayerMoney. Then, on OnPlayerUpdate:
Код:
if(GetPlayerMoney(playerid) > Player[playerid][Money])
{
 ...sets player money to Player[playerid][Money].
}
Reply
#4

you should use a timer like check every 5 sec. i think when using OnPlayerUpdate, Cheater can fast press enter and maybe anti money hack not work perfect !
Reply
#5

You don't need a constant check for money hacks... When you are trying to see how much money a player has, use Player[playerid][Money], NOT GetPlayerMoney. Make a 10 second timer that will reset their money if it doesn't match. This is the ONLY time you should be using GetPlayerMoney.

pawn Код:
public OnPlayerConnect(playerid)
{
    SetTimerEx("MoneyCheck", 10000, true, "i", playerid);
    return 1;
}

forward MoneyCheck(id);
public MoneyCheck(id)
{
    if(GetPlayerMoney(id) != Player[id][Money])
    {
        //Set player money to Player[id][Money]
    }
    return 1;
}
Reply
#6

To be honest, who cares what the player sees if they cheat money.

Just keep track of their money on the server side, and when you check to see how much money they have, read from the variable their money is stored in on the server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)