Money Bug
#1

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

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
Reply
#3

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

BUMP
Reply
#5

Код:
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"));
}
Reply
#6

Show the store commands CallRemoteFunction.
Reply
#7

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); 
Reply
#8

bump
Reply
#9

help me please .. anyone?
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)