29.03.2015, 20:07
Hello.
Is there any use for CallLocalFunction?
If you don't know, it's used to call public functions within your script, here's an example:
But the thing is, you can also use this:
We'll call this "plain" CallLocalFunction.
And using this method works for both plain and public functions, while CallLocalFunction only works for public functions.
So what's CallLocalFunction for? Is it just completely useless, or is there something it can do which the "plain" CallLocalFunction can't?
Is there any use for CallLocalFunction?
If you don't know, it's used to call public functions within your script, here's an example:
pawn Code:
public SendRandomMessage(playerid)
{
switch(random(2))
{
case 0: SendClientMessage(playerid, -1, "Msg1");
case 1: SendClientMessage(playerid, -1, "Msg2");
}
return 1;
}
CMD:randommessage(playerid)
{
CallLocalFunction("SendRandomMessage", "i", playerid);
return 1;
}
pawn Code:
CMD:randommessage(playerid)
{
SendRandomMessage(playerid);
return 1;
}
And using this method works for both plain and public functions, while CallLocalFunction only works for public functions.
So what's CallLocalFunction for? Is it just completely useless, or is there something it can do which the "plain" CallLocalFunction can't?