CallRemoteFunction - 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: CallRemoteFunction (
/showthread.php?tid=531539)
CallRemoteFunction -
alanhutch - 13.08.2014
Hi all..
I have a Vehicle System FS and a Gamemode...
I have created a function in the Gamemode, and I have decided to use it in the FS.
Why this CallRemoteFunction don't work?
pawn Код:
CallRemoteFunction("AccendereAuto", "i", 69);
The function:
pawn Код:
forward AccendereAuto(playerid);
public AccendereAuto(playerid)
{
gNonPuoi[playerid] = 1;
return 1;
}
If I call that function in the GM works.
Thanks for the help
Re: CallRemoteFunction -
Blademaster680 - 13.08.2014
I never understood callremotefunction. I could never get them to work. What you could try is SetPVarInt and then in the gamemode try run a timer and GetPVarInt... That might work...
Another option is to #include the FS at the top of your script, then you can use the function without callremotefunction...
Re: CallRemoteFunction -
GGW - 13.08.2014
does the Function in the
GM and the FS or
only in GM ?
Re: CallRemoteFunction -
AIped - 13.08.2014
you have this;
pawn Код:
CallRemoteFunction("AccendereAuto", "i", 69);
try this;
pawn Код:
CallRemoteFunction("AccendereAuto", "s", "accenderauto called");
Re: CallRemoteFunction -
CutX - 13.08.2014
Quote:
Originally Posted by AIped
you have this;
pawn Код:
CallRemoteFunction("AccendereAuto", "i", 69);
try this;
pawn Код:
CallRemoteFunction("AccendereAuto", "s", "accenderauto called");
|
this would only fuck up things as his "function" expects an integer, no string
Quote:
Originally Posted by alanhutch
Hi all..
I have a Vehicle System FS and a Gamemode...
I have created a function in the Gamemode, and I have decided to use it in the FS.
Why this CallRemoteFunction don't work?
pawn Код:
CallRemoteFunction("AccendereAuto", "i", 69);
The function:
pawn Код:
forward AccendereAuto(playerid); public AccendereAuto(playerid) { gNonPuoi[playerid] = 1; return 1; }
If I call that function in the GM works.
Thanks for the help
|
youset it up correctly, the only thing is that youre passing '69' as playerid to the function, so you couldn't "see" any changes... i belife you jsut copy&pasted that from the wiki and tought that '69' is something which has to be there ^^
do it like this:
pawn Код:
CallRemoteFunction("AccendereAuto", "i", playerid);
and you'll notice it worked
(it worked before too but you just didn't notice cuz 69 wasn't your playerid)
Re: CallRemoteFunction -
AIped - 13.08.2014
thanks for fixing/clearing up my answer too CutX
Alanhutch listen to CutX his way works.