15.07.2011, 22:49
Quote:
example: so?
Код:
public OnPlayerConnect(playerid) { CallRemoteFunction("OnPlayerConnect", "i", playerid); return 1; } |
When you said you wanted to know how to use these functions, did you mean you wanted to know what they do? I thought you were asking for help on their syntax .
CallRemoteFunction calls a public function inside any loaded script. Lets say you have a public function in a filterscript called "Test" that you wanted to call from your GM. You would use this function to call it, and possibly use the return value from said function.
CallLocalFunction does the same, except it only works for the script its used it.
These functions only work with publics, as when you declare something public its name becomes visible to the virtual machine. Since we're passing the functions name as the first param the VM has to actually KNOW the name- hence the public.