SA-MP Forums Archive
[HELP] AntiMoneyHack timer - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] AntiMoneyHack timer (/showthread.php?tid=255811)



[HELP] AntiMoneyHack timer - KeyWay - 17.05.2011

The point of this is, that if you tune your vehicle at PayNSpray, it will take your money and then sets the current money amount, to serversided money. In that way tuning will actually cost money. I hope you understand what i mean.

So here what i've done so far:

I have this under 1 second timer.
pawn Код:
if(GetPlayerCash(i) > GetPlayerMoney(i))
{
        PlayerInfo[i][pMoney] = GetPlayerMoney(i);
        ResetPlayerMoney(i);
        GivePlayerMoney(i, PlayerInfo[i][pMoney]);
        UpdateMoney(i);
}
else{   }
Is there something im doing wrong?


GetPlayerCash is this:

pawn Код:
stock GetPlayerCash(playerid)
{
    return PlayerInfo[playerid][pMoney];
}



Re: [HELP] AntiMoneyHack timer - yanir3 - 17.05.2011

Quote:

PlayerInfo[i][pMoney] = GetPlayerMoney(i);

Well, you made a mistake, I guess.

I guess it's
PlayerInfo[i][pMoney] = GetPlayerCash(i);


Respuesta: [HELP] AntiMoneyHack timer - TheChaoz - 17.05.2011

pawn Код:
if(Pinfo[playerid][money] > GetPLayerMoney(playerid)){
    //what ever u want to do



Re: Respuesta: [HELP] AntiMoneyHack timer - KeyWay - 17.05.2011

Quote:
Originally Posted by the_chaoz
Посмотреть сообщение
pawn Код:
if(Pinfo[playerid][money] > GetPLayerMoney(playerid)){
    //what ever u want to do
That would be the same, with GetPlayerCash, if you see what my stock includes?

Well i tried that too just in case, but it still set's my Money and pMoney to 0$...

Quote:
Originally Posted by yanir3
Посмотреть сообщение
Well, you made a mistake, I guess.

I guess it's
PlayerInfo[i][pMoney] = GetPlayerCash(i);
This way it will get players pMoney, and sets it to pMoney, doesnt make sense... :S


Re: [HELP] AntiMoneyHack timer - cessil - 17.05.2011

what does UpdateMoney(i) do? it seems you have everything done already.

Also you should check how much the money has gone down since if they cheat to make the money go really really low it'll wrap around and they'll have billions


Re: [HELP] AntiMoneyHack timer - KeyWay - 17.05.2011

Quote:
Originally Posted by cessil
Посмотреть сообщение
what does UpdateMoney(i) do? it seems you have everything done already.

Also you should check how much the money has gone down since if they cheat to make the money go really really low it'll wrap around and they'll have billions
UpdateMoney just updates the textdraw for player...

I also have GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]); under OnPlayerSpawn, so the player have's the 'gamemoney'. But still i get 0$, even when i do ingame /money 0 1000 it gets reseted to 0$. Hmmm


Re: [HELP] AntiMoneyHack timer - cessil - 17.05.2011

ah that could be lag then, if you set a variable to 1000 but it takes 1.5seconds to update on your client the script will see you have $0 client side and then reset the server variable to 0


Re: [HELP] AntiMoneyHack timer - KeyWay - 17.05.2011

Quote:
Originally Posted by cessil
Посмотреть сообщение
ah that could be lag then, if you set a variable to 1000 but it takes 1.5seconds to update on your client the script will see you have $0 client side and then reset the server variable to 0
Ahh yeah i though so, so i should make the check starting in few second then.(?)

But thank you for your reply and for reminding of checking the billion money thing!


Respuesta: [HELP] AntiMoneyHack timer - TheChaoz - 17.05.2011

did u ever change the player var integer? i mean did u set the amount of money that the player hve to that array?