SA-MP Forums Archive
[TUTORIAL] How To Stop Money Hackers! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [TUTORIAL] How To Stop Money Hackers! (/showthread.php?tid=151100)



[TUTORIAL] How To Stop Money Hackers! - Kyle - 29.05.2010

This tutorial will stop cash hackers, But the only problem is that tranfender is free! Anyway Enjoy.

Also: If you want to give people cash do,

pawn Код:
PlayerCash[playerid] += amount here;

Step 1:

Place This At The Top Of Your Script.

pawn Код:
new PlayerMoney[MAX_PLAYERS];
new OldCash[MAX_PLAYERS];
forward PlayerTimer()
Then Place The Following Code Under Onplayerconnect and OnPlayerDisconnect
pawn Код:
PlayerMoney[playerid] = 0;
OldCash[playerid] = 0;
Step 2:

Put this code under OnGameModeInit, This will set a timer for PlayerTimer to declare.

pawn Код:
SetTimer("PlayerTimer",1000,1);
Step 3:

Then This Public Will Check If Its Severside Cash Increase Or Client.

pawn Код:
public PlayerTimer()
{
  for(new i=0; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(GetPlayerMoney(i) != PlayerCash[i])
      {
         OldCash[i] = GetPlayerMoney(i);
      ResetPlayerMoney(i);
      GivePlayerMoney(i,PlayerCash[i]);
      return 1;
        }
       }
    }
    return 1;
}
Sorry About Indentation!


Re: [TUTORIAL] How To Stop Money Hackers! - [NYRP]Mike. - 29.05.2010

It's good, I use the same thing on my script... Works all the time hehe...