25.07.2013, 21:25
Okay im experiencing a severe money hacker problem. However i AM using the server sided money but they are still getting trough... How in the chicken can they do that?
Cash[playerid]
if(!strcmp(cmdtext, "/m4", true)){
if(Money[playerid] < 5000)return SendClientMessage(playerid, 0x00FFFFAA, "* {FFFFFF}You donґt have enough money!");
GivePlayerWeapon(playerid, 31, 500);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, Money[playerid]-5000);
return 1;
}
You canґt stop cheaters they will cheat money.. You can just detect it..
|
// Global
new
Real_Money[ MAX_PLAYERS ]
;
// OnPlayerConnect
Real_Money[ playerid ] = 0;
stock GetUserMoney( playerid ) return Real_Money[ playerid ];
stock GiveUserMoney( playerid, money )
{
Real_Money[ playerid ] += money;
ResetPlayerMoney( playerid );
GivePlayerMoney( playerid, Real_Money[ playerid ] );
}
stock ResetUserMoney( playerid )
{
Real_Money[ playerid ] = 0;
ResetPlayerMoney( playerid );
}
stock SetUserMoney( playerid, money )
{
Real_Money[ playerid ] = money;
ResetPlayerMoney( playerid );
GivePlayerMoney( playerid, Real_Money[ playerid ] );
}
// Timer's callback
forward OnServerCheckMoney( );
public OnServerCheckMoney( )
{
new
money
;
foreach(new playerid : Player)
{
money = GetPlayerMoney( playerid );
if( money < Real_Money[ playerid ] && money > -1 ) Real_Money[ playerid ] = money; // if they lost money from client side (burger shops, ammunation, casino, pay n spray etc
if( GetUserMoney( playerid ) < 0 ) Real_Money[ playerid ] = 0; // i don't want less than 0
else if( GetUserMoney( playerid ) > 999999999 ) Real_Money[ playerid ] = 999999999; // and more than 999,999,999
ResetPlayerMoney( playerid );
GivePlayerMoney( playerid, Real_Money[ playerid ] );
}
}