Best Anti-Money Hack Method (Server Sided Money) Discussion
#5

Quote:
Originally Posted by Dignity
View Post
Since you saved me from creating my own thread, I'll hijack it with a question and also a possible example.

Would this be a viable anti cheat? Please tell me why not if it's not.

PHP Code:
OnPlayerMoneyChange playerid ) {
    new 
string 64 ] ;
    if ( 
AC_GetPlayerMoney playerid ) != GetPlayerMoney playerid ) ) {
        
format stringsizeof ( string ), "ANTICHEAT: Serverside money: %d | Clientside money: %d"AC_GetPlayerMoney playerid ), GetPlayerMoney playerid ) );
        
SendClientMessage playeridANTICHEAT_COLOURstring ) ;
    }
    return 
true ;
}
AC_GetPlayerMoney playerid ) {
    
OnPlayerMoneyChange playerid ) ;
    return 
antiCheat_playerMoney playerid ] ;
}
AC_GivePlayerMoney playeridamount ) {
    
antiCheat_playerMoney playerid ] += amount ;
    
OnPlayerMoneyChange playerid ) ; // Anti cheat
    
    
return GivePlayerMoney playeridamount );
}
#define GivePlayerMoney     AC_GivePlayerMoney 
AC_GivePlayerMoney will give false warnings.

The order goes like this:
variable change
OnPlayerMoneyChange
GivePlayerMoney

So basically, you're calling the anticheat before giving the actual money.
Which means the variable != the money, because you haven't given the money yet.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)