Little help with CallRemoteFunc
#1

Hey!

So i have this in my gamemode:

Код:
forward SetPlayerVarMoney(playerid);
public SetPlayerVarMoney(playerid)
{
	PlayerInfo[playerid][pCash] += 20;
}
and this is in the FS:

Код:
CallRemoteFunction("SetPlayerVarMoney", "i", playerid);
What i want to do is, that i can change value in FS, so that parameter 2 in function would be value.

Код:
So it could be CallRemoteFunction("SetPlayerVarMoney", "i", 100);
Somehow my logic dosn't help me, adding 2 params gives me error. Im probably missing something really simple.
Reply
#2

What kind of errors? A second parameter is needed for the amount of money
pawn Код:
forward SetPlayerVarMoney(playerid, cash);
public SetPlayerVarMoney(playerid, cash)
{
    PlayerInfo[playerid][pCash] += cash;
}
as well as when calling from a filterscript:
pawn Код:
CallRemoteFunction("SetPlayerVarMoney", "ii", playerid, cash_here);
EDIT: Sorry, didn't refresh the page.
Reply
#3

Oh, just had to add another ''i''.
Thank you both.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)