04.12.2016, 16:01
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.
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 ( string, sizeof ( string ), "ANTICHEAT: Serverside money: %d | Clientside money: %d", AC_GetPlayerMoney ( playerid ), GetPlayerMoney ( playerid ) );
SendClientMessage ( playerid, ANTICHEAT_COLOUR, string ) ;
}
return true ;
}
AC_GetPlayerMoney ( playerid ) {
OnPlayerMoneyChange ( playerid ) ;
return antiCheat_playerMoney [ playerid ] ;
}
AC_GivePlayerMoney ( playerid, amount ) {
antiCheat_playerMoney [ playerid ] += amount ;
OnPlayerMoneyChange ( playerid ) ; // Anti cheat
return GivePlayerMoney ( playerid, amount );
}
#define GivePlayerMoney AC_GivePlayerMoney