CallRemoteFunction

From SA-MP Wiki

Jump to: navigation, search

CallRemoteFunction


Calls a public function from within the entire server, this doesn't have to be defined in any way.


Important note: This calls the public function from all of the scripts loaded into the server.


Parameters:
(const format[], {Float,_}:...)
function[]Public functions' name.
format[]Tag/format of each variable
{Float,_}:...'Indefinite' number of arguments of any tag


ReturnsThe value that the last public function returned.


Format Strings

Placeholder Meaning
c Inserts a single character.
d, i Inserts an integer (whole) number
x Inserts a number in hexadecimal notation.
f Inserts a floating point number.
s Inserts a string.

The values for the placeholders follow in the exact same order as parameters in the call.

forward callMe(const string[]);
public  callMe(const string[])
{
    printf("callMe> %s", string);
    return 86;
}
 
/* Somewhere... in another file prehaps? */
CallRemoteFunction("callMe", "s", "OHAI THAR BAGPUSS!!11");

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.