SA-MP Forums Archive
Serverside money - 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)
+--- Thread: Serverside money (/showthread.php?tid=412922)



Serverside money - Sime30 - 03.02.2013

I have a problem with money on my server. When someone buys a car ( it reduces his money) and then someone gives him atleast 1$ it will reset his money to the moment when he was buying a car , if you understand me.

I have these codes in my GM and also I am using JunkBuster ( variable for money hack is turned off )
pawn Код:
stock GivePlayerCash(playerid, money)
{
    Cash[playerid] += money;
    ResetMoneyBar(playerid);//Reseta novac u originalni bar
    UpdateMoneyBar(playerid,Cash[playerid]);//Stavlja novac u originalni bar
    return Cash[playerid];
}
stock SetPlayerCash(playerid, money)
{
    Cash[playerid] = money;
    ResetMoneyBar(playerid);//Reseta novac u originalni bar
    UpdateMoneyBar(playerid,Cash[playerid]);//Stavlja novac u originalni bar
    return Cash[playerid];
}
stock ResetPlayerCash(playerid)
{
    Cash[playerid] = 0;
    ResetMoneyBar(playerid);//Reseta novac u originalni bar
    UpdateMoneyBar(playerid,Cash[playerid]);//Stavlja novac u originalni bar
    return Cash[playerid];
}
stock GetPlayerCash(playerid)
{
    return Cash[playerid];
}

    stock sscanf(string[], format[], {Float,_}
:...)
{



Re: Serverside money - Sime30 - 03.02.2013

Anyone please, its urgent!!!


Re: Serverside money - T0pAz - 03.02.2013

The problem is not within the code you have provided. Make sure to use GivePlayerCash not GivePlayerMoney.


Re: Serverside money - Sime30 - 03.02.2013

So you saying I must change every GivePlayerMoney to GivePlayerCash... i.e. /givemoney - it must be GivePlayerCash(playerid, money);


Re: Serverside money - T0pAz - 03.02.2013

Quote:
Originally Posted by Sime30
Посмотреть сообщение
So you saying I must change every GivePlayerMoney to GivePlayerCash... i.e. /givemoney - it must be GivePlayerCash(playerid, money);
Yes, as well as GetPlayerMoney to GetPlayerCash. Just use the find&replace function of your IDE.


Re: Serverside money - Sime30 - 03.02.2013

Okay, thank you very much for your anwser!!!
REP +1