anti money hack[+rep]
#1

hi,

is this code good?
If i try to cheat money with a cheating tool it works, it deects it and resets it but the client message is also send if the money is not hacked.

to sum it up:

-it detects and resets cheated money (not given with the custom variable)
-It doesnt reset the money given with the custom variable (this is supposed to be so)
-BUT the "hacked money" message is always send when the money gets increased/decreased, no matter if its cheated or not.

pawn Код:
//this is in a foreach loop and a timer with 1 second intervall
        if(GetPlayerMoney(i) != pCash[i])
        {
            ResetPlayerMoney(i);
            GivePlayerMoney(i, pCash[i]);
            SendClientMessageToAll(0xFF0000FF,"Money Hacked!!");
        }

//i give money like this:
pCash[playerid]+=amount;
Please help me
Reply
#2

pawn Код:
//this is in a foreach loop and a timer with 1 second intervall
        if(GetPlayerMoney(i) >= pCash[i])
        {
            ResetPlayerMoney(i);
            GivePlayerMoney(i, pCash[i]);
            SendClientMessageToAll(0xFF0000FF,"Money Hacked!!");
        }



Stock SafeGivePlayerMoney(playerid, amount)
{
pCash[playerid] =+amount;
GivePlayerMoney(playerid,amount);
}
And Replace all your GivePlayerMoney by SafeGivePlayerMoney. I hope, i help you
Reply
#3

thx
Can someone tell, if this code is more efficientor safer then my first code?

And if my code works, why is it always showing the hacked money message?

I want to know that please
Reply
#4

Cause if(GetPlayerMoney(i) != pCash[i]) if you give money to your player, its different to pCash, so message will be send.
Reply
#5

Quote:
Originally Posted by PawnoQ
Посмотреть сообщение
thx
Can someone tell, if this code is more efficientor safer then my first code?

And if my code works, why is it always showing the hacked money message?

I want to know that please
lol.

Yes It is because your code does not do what you want it to do. (derp)

Edit:
answer to second question: You're code does not set the money, so pCash is never equal to GetPlayerMoney, thats why your getting the message
Reply
#6

ok, if i use ur code, can i go on with using GetPlayerMoney then?
Reply
#7

sorry for double post but is there any difference if i give my serverside money like this

pawn Код:
pCash[playerid]+=amount;
//this would be as safe as the stock function right?
or this?

pawn Код:
Stock SafeGivePlayerMoney(playerid, amount)
{
pCash[playerid] =+amount;
GivePlayerMoney(playerid,amount);
}
Reply
#8

The only difference is that the green money in the top right corner will change too with the second one.

Edit: If you want to use GetPlayerMoney, you can use something like this instead:
Код:
stock SafeGetPlayerMoney(playerid)
{
	return pCash[playerid];
}
Reply
#9

the first method affects the green money bar as well
So it actually would be the same right?
Reply
#10

If it both affects the green money, then there is no difference.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)