Anti Money Hack: Is this effective?
#1

hi,

im using a simple but untill today i thought very effective anti money hack script:

pawn Код:
new Cash[MAX_PLAYERS];

//OnGameModeInit
SetTimer("AntiCheat",200,true);


forward AntiCheat();
public AntiCheat()
{

    foreach(Player, i)
    {
        if(GetPlayerMoney(i) != Cash[i])
        {
        ResetPlayerMoney(i);
        GivePlayerMoney(i, Cash[i]);
        }
    }

}

//And im giving money like this:
Cash[playerid] += 2000;
//or
Cash[playerid] -= 2000;
This always worked perfect, ive also tested it myself with different money hacks and it always detected the hacked money and resetted it back to the normal legal money amount.

But yesterday there came a guy to the server and started to give all players huge money amounts, like: 10000000$+!!

How is this possible? How can i fix this?
Is there a more effective anti money hack available?
Or where is the bug in this script?

Would be very happy about some advices.

Thx in advance, wolf.
Reply
#2

depends how the give money works, if you only use your variables then you have some money bug or something that they're exploiting, if you use GetPlayerMoney and they freeze their money then they'd keep getting money using your system.
Reply
#3

Quote:
Originally Posted by cessil
Посмотреть сообщение
depends how the give money works, if you only use your variables then you have some money bug or something that they're exploiting, if you use GetPlayerMoney and they freeze their money then they'd keep getting money using your system.
Incorrect, that will not affect the money that server thinks the client has.

I perform my anti cheat operations using the code below, but it's up to you.
pawn Код:
public OnPlayerUpdate(playerid)
{
    SetPlayerMoney(playerid, PlayerInfo[playerid][pCash]);
    return 1;
}
Note: the above code is not good to use, it is an unstable choice, and certainly a flawed one.
Reply
#4

Maybe there's an exploit involving the '-' symbol because sometimes on servers if you do /deposit -5000 for example (it's patched in almost every server) you get -5000 added to your bank and $5,000 added to your cash amount. Got to watch out for that.
Reply
#5

#define GetPlayerMoney(%0) Cash[%0]

Put this on top.
Reply
#6

See this tutorial and try it:

https://sampforum.blast.hk/showthread.php?tid=71136

This tutorial is based on Serverside money, When he spawn instantly the spawned money will be taken, He cannot send to anyone.

Credits: Norn!

Thanks
Reply
#7

Quote:
Originally Posted by Davz*|*Criss
Посмотреть сообщение
See this tutorial and try it:

https://sampforum.blast.hk/showthread.php?tid=71136

This tutorial is based on Serverside money, When he spawn instantly the spawned money will be taken, He cannot send to anyone.

Credits: Norn!

Thanks
Or use my include, since it's plug&play and has filterscript support
Reply
#8

thx alot for all ur answers

mhh, ive checked the tutorial but im confused...
The tutorial uses nearly the same method like me only in a longer version or am i wrong?
Maybe some of u could tell me if the anti money hack in the tutorial is really more effective then my code above.

Would be great. Ang i currently dont have no deposit/bank system on my server and the givecash cmd is fine, ive checked it, but thx anyway for the hint.
Reply
#9

Yeah that tutorial is effective i have tested it too in my server, its very impossible to hack money.

Try that its good.
Reply
#10

the prob is ive also tested alot of hacks with my system and it always worked.
But one guy did it though so in the tutorial's system it also might be possible like he did it with my system.

The prob is i duno how this guy did it so i cant test it for security holes..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)