Little help with CallRemoteFunc - 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: Little help with CallRemoteFunc (
/showthread.php?tid=614243)
Little help with CallRemoteFunc -
Xeuq - 06.08.2016
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.
Re: Little help with CallRemoteFunc -
Konstantinos - 06.08.2016
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.
Re: Little help with CallRemoteFunc -
Xeuq - 06.08.2016
Oh, just had to add another ''i''.
Thank you both.