Serverside money
#1

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,_}
:...)
{
Reply
#2

Anyone please, its urgent!!!
Reply
#3

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

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

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.
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)