SA-MP Forums Archive
CallRemoteFunction with reference variable - 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 with reference variable (/showthread.php?tid=446372)



CallRemoteFunction with reference variable - Swimor - 25.06.2013

CallRemoteFunction with reference variable

Hello,
I interested, is there any way to CallRemoteFunction with reference variable?

Thanks,
RaFaeL.


Respuesta: CallRemoteFunction with reference variable - JustBored - 25.06.2013

pawn Код:
public OnGameModeInit()
{
CallRemoteFunction("Function", "sd","Swimor you should checkout the wiki", "123");
return 1;
}
public Function(const string[], number)
{
printf("We have a message: %s", string)
printf("And also we have a number: %d", number);
return 1;
}
https://sampwiki.blast.hk/wiki/CallRemoteFunction


AW: CallRemoteFunction with reference variable - Nero_3D - 25.06.2013

You can't use a reference variable since the remote function dont share the same memory block
Therefore the remote function cant modify the memory of the caller

But it should work with local functions and CallLocalFunctions

(Thats what I am thinking, cant prove that)

I think that there is some code in YSI which allows something like that
But that mostly works over properties or any other code which isnt limited to the script


Re: AW: CallRemoteFunction with reference variable - Swimor - 26.06.2013

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
You can't use a reference variable since the remote function dont share the same memory block
Therefore the remote function cant modify the memory of the caller

But it should work with local functions and CallLocalFunctions

(Thats what I am thinking, cant prove that)

I think that there is some code in YSI which allows something like that
But that mostly works over properties or any other code which isnt limited to the script
Thanks, Great answer!
I found Slice's fixed CallLocalFunction here:
http://forum.sa-mp.com/showpost.php?...postcount=2950