SA-MP Forums Archive
CallLocalFunction vs Normal calling - 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: CallLocalFunction vs Normal calling (/showthread.php?tid=441621)



CallLocalFunction vs Normal calling - Bharel - 03.06.2013

I found CallLocalFunction in the wiki and wondered, whats the point of it?
Why would someone use it, and not just normally type the function?

Код:
public Foo(playerid)
{
    //lots of code
    return cupcake;
}

cupcake = CallLocalFunction("Foo", "i", playerid); //Difference between this
cupcake = Foo(playerid); //and this



Re: CallLocalFunction vs Normal calling - Bharel - 03.06.2013

Oh so that's how ZCMD works. Basically you can format the string to say COMMAND:%s.
Awesome, thanks a lot!


Re: CallLocalFunction vs Normal calling - Pottus - 03.06.2013

Also useful for callbacks which may or may not be used as it will not return a error/warning if the function is not present.