SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 22/02/2009, 08:52 PM   #1
Martin_Smith
Big Clucker
 
Join Date: Jan 2008
Posts: 120
Reputation: 0
Default Money Hacking e.t.c.

for my server, i want to make a ANTI hack system, i know how im going to do it..sort of..

Basicly, what i want to do is if you get 501 money or more in a second, its kick and i anna do it if ur a special team and Have blah blah guns, u get banned

So, all i need to know is where do i put the code for these?
Martin_Smith is offline  
Old 22/02/2009, 08:58 PM   #2
Martin_Smith
Big Clucker
 
Join Date: Jan 2008
Posts: 120
Reputation: 0
Default Re: Money Hacking e.t.c.

so, which Public or whatever?
Martin_Smith is offline  
Old 22/02/2009, 08:58 PM   #3
Sandra18[NL]
Huge Clucker
 
Join Date: Jun 2007
Posts: 401
Reputation: 54
Default Re: Money Hacking e.t.c.

Code:
new LastMoney[MAX_PLAYERS];
//OnGameModeInit
Code:
SetTimer("AntiMoneyCheat", 1000, 1);


//OnPlayerConnect(playerid)
Code:
LastMoney[playerid] = 0;
Code:
forward AntiMoneyCheat();
public AntiMoneyCheat()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    { 
      if(LastMoney[i] > 0)
      {
        if(GetPlayerMoney(i) - LastMoney[i] > 500)
        {
          SendClientMessage(i, 0xFF0000AA, "Money Cheater");
          Ban(i);
        }
      }
      LastMoney[i] = GetPlayerMoney(i);
    }
  }
}
Sandra18[NL] is offline  
Old 22/02/2009, 09:04 PM   #4
Martin_Smith
Big Clucker
 
Join Date: Jan 2008
Posts: 120
Reputation: 0
Default Re: Money Hacking e.t.c.

Does this make it, so if you gain 500 in a second, ur banned?
Martin_Smith is offline  
Old 22/02/2009, 09:09 PM   #5
Sandra18[NL]
Huge Clucker
 
Join Date: Jun 2007
Posts: 401
Reputation: 54
Default Re: Money Hacking e.t.c.

Quote:
Originally Posted by Martin_Smith
Does this make it, so if you gain 500 in a second, ur banned?
Yes, it compares every second your money with the money you had a second ago, if the diffrence is more than 500, you'll get banned.
Sandra18[NL] is offline  
Old 22/02/2009, 09:19 PM   #6
Martin_Smith
Big Clucker
 
Join Date: Jan 2008
Posts: 120
Reputation: 0
Default Re: Money Hacking e.t.c.

ffs, im too tired for errors:

Code:
C:\Documents and Settings\test\Desktop\GTA\GTA\GTA San Andreas\samp02Xserver.win32\gamemodes\nazi.pwn(948) : error 001: expected token: ";", but found "-identifier-"


Code:
public AntiMoneyCheat()
{
  for(new i; i<MAX_PLAYERS i++)  // LINE 948!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  {
    if(IsPlayerConnected(i))
    {
      if(LastMoney[i] > 0)
      {
        if(GetPlayerMoney(i) - LastMoney[i] > 5000)
        {
          SendClientMessage(i, 0xFF0000AA, "Money Cheater");
          Kick(i);
        }
      }
      LastMoney[i] = GetPlayerMoney(i);
    }
  }
}
Martin_Smith is offline  
Old 22/02/2009, 09:21 PM   #7
Sandra18[NL]
Huge Clucker
 
Join Date: Jun 2007
Posts: 401
Reputation: 54
Default Re: Money Hacking e.t.c.

Sorry, i forgot a semicolon after MAX_PLAYERS

This should work:
Code:
for(new i; i<MAX_PLAYERS; i++)
Sandra18[NL] is offline  
Old 07/07/2011, 11:28 PM   #8
dowster
Gangsta
 
dowster's Avatar
 
Join Date: Jun 2010
Location: San Fierro
Posts: 629
Reputation: 69
Default Re: Money Hacking e.t.c.

just make an array
new money[MAX_PLAYERS]

then inside onplayerupdate put

if(GetPlayerMoney(playerid) != money[playerid])
{
new changeinmoney;
changeinmoney = (money[playerid] - GetPlayerMoney(playerid));
GivePlayerMoney(playerid, changeinmoney);
return 1;
}

this will make all money serversided so instead of giveplayermoney to actually give them money it would be
money[playerid] = (money[playerid] + amount)

shit sorry for bump, this had popped up in suggested threads, didnt bother checking the date. :/
__________________

Last edited by dowster; 07/07/2011 at 11:29 PM. Reason: Sorry for bump
dowster is offline  
Old 08/07/2011, 12:11 AM   #9
cessil
High-roller
 
cessil's Avatar
 
Join Date: Apr 2009
Posts: 1,353
Reputation: 310
Default Re: Money Hacking e.t.c.

Quote:
Originally Posted by Sandra18[NL] View Post
Yes, it compares every second your money with the money you had a second ago, if the diffrence is more than 500, you'll get banned.
That's one of the worst anti cheats I have ever seen, you completely ignored the possibility of lag.
If you want something that will work hook GivePlayerMoney and have it check and set a variable that stores that players max money that they've ever had during their connect time, then run a timer and see if their GetPlayerMoney is larger than that variable then you can do some punishment

edit: didn't read the above edit, oh well maybe someone else will stumble across this and it'll help them out too, for more tips on ACs check the link in my sig
cessil is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [INC] Serverside Weapon Hacking Eazy_Efolife Includes 22 02/08/2014 04:23 PM
[SARP] San Andreas Roleplay - Hacking issue/Complaint PowerSurge Server Support 2 02/06/2010 04:00 PM
About memory hacking plugins (avoid them) Kalcor Plugin Development 0 17/02/2010 10:49 AM
Help, someone is hacking my rcon BP13 Server Support 8 04/12/2009 07:20 PM
Help! Someone is hacking my server. Elorreli Help Archive 8 24/03/2009 10:54 PM


All times are GMT. The time now is 11:38 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.