SA-MP Forums Archive
[TUTORIAL] Serverside Money. (Impossible to hack) - 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] Serverside Money. (Impossible to hack) (/showthread.php?tid=71136)

Pages: 1 2 3


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Nero_3D - 18.06.2009

Quote:
Originally Posted by KeyWay
Do i need to replace GivePlayerMoney etc. to GivePlayerCash etc. ?
You need to do that so the players wont get kicked when you use GivePlayerMoney
Just check if you start the timer, thats the SetTimer part


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - KeyWay - 18.06.2009

Quote:
Originally Posted by ♣ ⓐⓢⓢ
Quote:
Originally Posted by KeyWay
Do i need to replace GivePlayerMoney etc. to GivePlayerCash etc. ?
You need to do that so the players wont get kicked when you use GivePlayerMoney
Just check if you start the timer, thats the SetTimer part
Well they dont get kicked when i give them money... And i didnt replace the GIvePlayerMoney, so it means this doesnt work?


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Nero_3D - 18.06.2009

Quote:
Originally Posted by KeyWay
Well they dont get kicked when i give them money... And i didnt replace the GIvePlayerMoney, so it means this doesnt work?
No, that wanst what I meant
I meant, it looks like you forgot to start the timer

Quote:
Originally Posted by Norn
OnGameModeInit
pawn Code:
SetTimer("MoneyTimer", 1000, 0);
or you forgot to add

Quote:
Originally Posted by Norn
pawn Code:
forward MoneyTimer();
public MoneyTimer()
{
    new username[MAX_PLAYER_NAME];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerCash(i) != GetPlayerMoney(i))
            {
                ResetMoneyBar(i);//Resets the money in the original moneybar, Do not remove!
                UpdateMoneyBar(i,GetPlayerCash(i));//Sets the money in the moneybar to the serverside cash, Do not remove!
                new hack = GetPlayerMoney(i) - GetPlayerCash(i);
                GetPlayerName(i,username,sizeof(username));
                printf("%s has picked up/attempted to spawn $%d.", username,hack);
            }
        }
    }
}



Re: [TUTORIAL] Serverside Money. (Impossible to hack) - KeyWay - 18.06.2009

No, i added everything that it says, it still doesnt work, maybe because im using Moneyz and NegativeMoneyz FS?


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Nero_3D - 18.06.2009

Quote:
Originally Posted by KeyWay
No, i added everything that it says, it still doesnt work, maybe because im using Moneyz and NegativeMoneyz FS?
Ah, ok, after I read your message I looked through the code (before I just belived in the rightness of the post)
BUT there is an mistake

Quote:
Originally Posted by Norn
OnGameModeInit
pawn Code:
SetTimer("MoneyTimer", 1000, 0);
That should be

Quote:
Originally Posted by Norn
OnGameModeInit
pawn Code:
SetTimer("MoneyTimer", 1000, 1);
Note: The 1 instead of 0 because 1 (true) is the reapeating parameter, if it would be 0 the timer stops after his first call and wont work!


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - KeyWay - 18.06.2009

Quote:
Originally Posted by ♣ ⓐⓢⓢ
Quote:
Originally Posted by KeyWay
No, i added everything that it says, it still doesnt work, maybe because im using Moneyz and NegativeMoneyz FS?
Ah, ok, after I read your message I looked through the code (before I just belived in the rightness of the post)
BUT there is an mistake

Quote:
Originally Posted by Norn
OnGameModeInit
pawn Code:
SetTimer("MoneyTimer", 1000, 0);
That should be

Quote:
Originally Posted by Norn
OnGameModeInit
pawn Code:
SetTimer("MoneyTimer", 1000, 1);
Note: The 1 instead of 0 because 1 (true) is the reapeating parameter, if it would be 0 the timer stops after his first call and wont work!
Thanks! It works now.

But what if i have FS using GivePlayerMoney etc. ?
I need to make timer and all that IN to FS too?


Respuesta: [TUTORIAL] Serverside Money. (Impossible to hack) - ipsBruno - 16.11.2010

Good Tuto

pawn Code:
stock GivePlayerCash(playerid,cash)
    SetPVarInt(playerid,"SSM",GetPVarInt(playerid,"SSM")+cash);
   
stock UpdatePlayerMoney(playerid)
    if(GetPVarInt(playerid,"SSM") < GetPlayerMoney(playerid))
        GivePlayerMoney(playerid,GetPVarInt(playerid,"SSM")-GetPlayerMoney(playerid));

public OnPlayerUpdate(playerid)
    UpdatePlayerMoney(playerid);



Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Mean - 25.12.2010

Could put BanEx(playerid.. );
But useful. Like in some roleplay servers, I saw this.


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - yvoms - 26.12.2010

Quote:
Originally Posted by cristofer
View Post
Code:
\samp02Xserver.win32\gamemodes\aaaa.pwn(2105) : warning 235: public function lacks forward declaration (symbol "MoneyTimer")
How can i fix this ?
make a forward like

[pawno]
//timer
forward MoneyTimer();
[/pawno]

on the very top of the script


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Tomejus - 13.01.2011

Hello I have one problem sometimes when u buy something money come back for you after relog' or sometime... I use: GivePlayerCash(playerid, -12); example. I didin't edit anything so can't understand where's the problem.


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - jejemonerz123 - 15.01.2011

awesome But not In A RolePlay GameMode In RolePlay you Need to Work Hard For Cash not here free when they try to hack they are ******* all items are now free then what will they do to the hacked money lol


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - YungGee - 13.02.2011

@ Norn

what if i save money to a file? Then now i add this, Will it reset the saved/file money to 0 and start again?

Please reply


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Ironboy - 10.03.2011

Nice tutorial


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Davz*|*Criss - 10.03.2011

Thanks nice one u helped me out


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Roomeo - 10.03.2011

pawn Code:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(687) : warning 235: public function lacks forward declaration (symbol "MoneyTimer")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Any Solution?
script
pawn Code:
public MoneyTimer()
{
    new username[MAX_PLAYER_NAME];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerCash(i) != GetPlayerMoney(i))
            {
                ResetMoneyBar(i);//Resets the money in the original moneybar, Do not remove!
                UpdateMoneyBar(i,GetPlayerCash(i));//Sets the money in the moneybar to the serverside cash, Do not remove!
                new hack = GetPlayerMoney(i) - GetPlayerCash(i);
                GetPlayerName(i,username,sizeof(username));
                printf("%s has picked up/attempted to spawn $%d.", username,hack);
            }
        }
    }
}



Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Bu$ter - 10.03.2011

Quote:
Originally Posted by Roomeo
View Post
pawn Code:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(687) : warning 235: public function lacks forward declaration (symbol "MoneyTimer")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Any Solution?
script
pawn Code:
public MoneyTimer()
{
    new username[MAX_PLAYER_NAME];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerCash(i) != GetPlayerMoney(i))
            {
                ResetMoneyBar(i);//Resets the money in the original moneybar, Do not remove!
                UpdateMoneyBar(i,GetPlayerCash(i));//Sets the money in the moneybar to the serverside cash, Do not remove!
                new hack = GetPlayerMoney(i) - GetPlayerCash(i);
                GetPlayerName(i,username,sizeof(username));
                printf("%s has picked up/attempted to spawn $%d.", username,hack);
            }
        }
    }
}
You must forward MoneyTimer due to its custom function, to do this simply add

Code:
forward MoneyTimer();
at the top of your script or before public MoneyTimer()


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Norn - 13.05.2011

Didn't even notice but the timer hadn't been set on repeat, updated haha.


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - Venice - 21.05.2011

Work Good Thanks Man


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - alynutzj2p - 25.06.2011

how do I do if I give money / givemoney / or money orders admin etc. not to drop money, I would like the casino and win money to stay there without disappearing, will help me rot. THX


Re: [TUTORIAL] Serverside Money. (Impossible to hack) - FishyZ - 26.07.2013

Good tutorial, but how do you like give the player money?

Like if I want to give someone money I do /givemoney?
How I'll give him?