CallRemoteFunction
#1

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

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

does the Function in the GM and the FS or only in GM ?
Reply
#4

you have this;
pawn Код:
CallRemoteFunction("AccendereAuto", "i", 69);
try this;
pawn Код:
CallRemoteFunction("AccendereAuto", "s", "accenderauto called");
Reply
#5

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)
Reply
#6

thanks for fixing/clearing up my answer too CutX

Alanhutch listen to CutX his way works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)