[Include] [INC] Fallout's Anti Money Cheat System - inc works on multiple scripts!
#21

Enjoy :P
Reply
#22

Very nice but I get one problem..

gf-los-santos.pwn(2095) : error 021: symbol already defined: "strtok"
gf-los-santos.pwn(2111) : error 047: array sizes do not match, or destination array is too small

and my stock strtok looks like this:

//----------------------[ strtok() ] -------------------------------
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

Any suggestions?!
Reply
#23

Quote:
Originally Posted by SuperS82
Very nice but I get one problem..

gf-los-santos.pwn(2095) : error 021: symbol already defined: "strtok"
gf-los-santos.pwn(2111) : error 047: array sizes do not match, or destination array is too small

and my stock strtok looks like this:

//----------------------[ strtok() ] -------------------------------
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

Any suggestions?!
Delete it and try again.

If it didn't work then press undo and it'll be back.
Reply
#24

Quote:
Originally Posted by °ғαιιοцт°
Because this include saves the integers in files, you don't have that problem and it's possible to include this into more than 1 script!
Why are you using a file-based method, you could do that all by scripting, using properties or CallRemoteFunction. In this case i recommend you use properties, it's much more adapted for just sharing a value between scripts.
Reply
#25

but i don't understand how that works
Reply
#26

I figured it out and I did do it all in the script.

Thanks for the replies guys!!
Reply
#27

update:

there was a problem when your money changed more than 2 times (more than the maximum difference of 200) in less than 4 seconds (timer)
when i give myself -2000 in less than 4 seconds i get kicked;
this only happens for negative money

I think this is why it happens:
sometimes the timer checks the difference after
Код:
dini_IntSet(file, "Money", F_Money += amount);
happened, and before
Код:
GivePlayerMoney(playerid, amount);
happened,
than there is still a difference... (i guess ><)

I solved it this way:
when a difference is detected between the var money of the inc, and the real money of the player he won't get kicked yet...
(because it's maybe that bug)
than a 2sec. timer is activated that will check again if there is still a difference
if there is, he'll get kicked
if there isn't, it means that the weird bug found place

hehe i don't really know how to explain this.... i tried it and i hope you understand what i mean


however here's the new download link:
http://pawn.pastebin.com/f756c7af3
http://pastebin.com/fb23a376
(also edited in the 1st post)
Reply
#28

Nice Release
Reply
#29

hmm can anyone help me with this problem ><
I thought it was fixed (see 2 posts above) but it still doesn't work

The problem is that when i give negative money (like $-2000), sometimes the player gets kicked with reason: money cheat ($2000)

Does anyone knows how this is possible?

Quote:
Originally Posted by Loyal
Nice Release
thx
Reply
#30

i think something about the checking money :/ something about maths but i'm not good at that
Reply
#31

Quote:
Originally Posted by russiany
Hey Fallout. Works perfectly , but there's a problem.

If a retard use a hack which it sets the money , not add , you're antihack not works .
Yes you're right, this include only checks if the player's money is higher than the amount that it should be...
It doesn't check if it's lower
But you can simply change that, somewhere ik the script, you'll see an "if" that checks if the player's money is larger than the money he should have. So you need to add there: "or if money is lower than..."
i can't remember witch variables i used there (and i cant check it now) but i hope i've helped you a little
I'll take a look at it tomorrow.
Reply
#32

on ladmin, if i auto login, i will kicked always, what is wrong ? i set all giveplayermoney and setplayermoney to F_
Reply
#33

ok, i found way to cheat. Use some money hack and make money and before check(its every 4 sec) /q(uit game) and that money saves in acc. Very easy to hack
But i have solution, make another function almoust same as CheckMoney(); lets neme new CheckMoneyDisc(); and lets look like this
Код:
public CheckMoneyDisc()
{
  for(new i=0; i<GetMaxPlayers(); i++)
  {
      new file[128];
      format(file, sizeof(file), "F_AntiCheat/id_%i.ini", i);
      new F_Money;
      F_Money = dini_Int(file, "Money");
      new cash = GetPlayerMoney(i);
      if (cash > F_Money)
      {
        if ((cash-F_Money) > MAX_DIFFERENCE)
        {
          SetTimerEx("DifferenceDetected", 2000, 0, "i", i);
        }
      }
  }
}
only diference is that i have remove isplayerconnect becasue even player disconnect i want to check did he hack money! And functon CheckMoneyDisc() call on your gamemode on public OnPlayerDisconnect(playerid), but before "OnUpdatePlayer(playerid);". If you put after it will save hacked money into account.
Reply
#34

this be good for roleplays
Reply
#35

good job Fallout
like always
Reply
#36

are you sure this is also for filterscripts? because I installed this on my gamemode and on Ladmin filterscript, but when I use /setcash or when i get cash, I still getting kicked, and i changed all the Give,Reset and SetPlayerMoney, can it be that i only need to include it in my filterscript?
Reply
#37

How does it react on stunting, gambling, drinking sprunk and entering a taxi? It doesn't use the GivePlayerMoney function so that would trigger your script, no?
Reply
#38

Quote:
Originally Posted by [MOB
Tr1viUm ]
How does it react on stunting, gambling, drinking sprunk and entering a taxi? It doesn't use the GivePlayerMoney function so that would trigger your script, no?
it only detects a difference of 200$
Reply
#39

Can it be that if I got this, the money hack doesnt work, because if I give somebody cash it works, but if he relogs and the money load when he connect he get kicked :S
if(ServerInfo[GiveMoney] == 1) {F_ResetPlayerMoney(playerid); F_GivePlayerMoney(playerid, dUserINT(PlayerName2(playerid)).("money") ); }
this happend when a player connect
Reply
#40

nice working
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)