SA-MP Forums Archive
Money Bug - 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: Money Bug (/showthread.php?tid=645928)



Money Bug - AfiqIqbal - 07.12.2017

I was editing my house system (fs) so it will be compatible with serverside money function in my GM. I use CallRemoteFunction to call the function of the serverside money in my GM to my house system filterscript, it seems to work but one problem is when I try to buy a house, it gave me unlimited money, not taken any money from me. The store cash / withdraw cash in my house system works with CallRemoteFunction ...

Serverside money function :
PHP код:
forward GivePlayerCash(playeridmoney);
public 
GivePlayerCash(playeridmoney)
{
    
Account[playerid][Money] += money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridAccount[playerid][Money]);
    return 
Account[playerid][Money];

CallRemoteFunction under /buyhouse :
PHP код:
CallRemoteFunction("GivePlayerCash""dd"playerid, -hInfo[i][hPrice]);
format(string128"You have bought this house for $%d."hInfo[i][hPrice]);
SendClientMessage(playeridCOLOR_YELLOWstring); 
But it works when I use CallRemoteFunction("GivePlayerCash", "dd", playerid, blablabla) on another cmd like store cash or withdraw cash ..


Re: Money Bug - Kyle - 07.12.2017

Quote:

forward GivePlayerCash(playerid, money);
public GivePlayerCash(playerid, money)
{
ResetPlayerMoney(playerid);
if(money < 0) Account[playerid][Money] -= money;
else Account[playerid][Money] += money;
GivePlayerMoney(playerid, Account[playerid][Money]);
return Account[playerid][Money];
}

there, try that


Re: Money Bug - AfiqIqbal - 07.12.2017

Quote:
Originally Posted by Kyle
Посмотреть сообщение
there, try that
It's not working mate ..


Re: Money Bug - AfiqIqbal - 08.12.2017

BUMP


Re: Money Bug - jasperschellekens - 08.12.2017

Код:
GivePlayerMoneyEx(playerid,5000);
stock GivePlayerMoneyEx(playerid,amount)
{
	ResetPlayerMoney(playerid);
    SetPVarInt(playerid,"cash",GetPVarInt(playerid,"cash") + amount);
    if(GetPVarInt(playerid,"cash") > GetPVarInt(playerid,"maxcash")) SetPVarInt(playerid,"maxcash",GetPVarInt(playerid,"cash"));
	return GivePlayerMoney(playerid,GetPVarInt(playerid,"cash"));
}



Re: Money Bug - Sew_Sumi - 08.12.2017

Show the store commands CallRemoteFunction.


Re: Money Bug - AfiqIqbal - 08.12.2017

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Show the store commands CallRemoteFunction.
You mean this?

PHP код:
CallRemoteFunction("GivePlayerCash""dd"playerid, -strval(inputtext));
hInfo[hid][MoneyStore] = hInfo[hid][MoneyStore] + strval(inputtext);
new 
string[128];
format(string128"You have store your $%d into your house safe. ($%d over all in your safe)"strval(inputtext), hInfo[hid][MoneyStore]);
SendClientMessage(playerid, -1string); 



Re: Money Bug - AfiqIqbal - 08.12.2017

bump


Re: Money Bug - AfiqIqbal - 09.12.2017

help me please .. anyone?


Re: Money Bug - AfiqIqbal - 09.12.2017

no one? please urgent ... just give me a clue or something ...