Quote:
|
Originally Posted by /^We(stie|z+[e|a
r)$/ ]
Quote:
|
Originally Posted by °ғαιιοцт°
Why should I use CallLocalFunction if I can also just use the function's name to call it?
example:
Код:
forward examplefunction(playerid, Float:angle);
public examplefunction(playerid, Float:angle)
{
SetPlayerFacingAngle(playerid, angle);
return 1;
}
/* somewhere else in the script: */
CallLocalFunction("examplefunction", "if", playerid, "90.0");
/* but I could also use this: */
examplefunction(playerid, "90.0");
|
There are two functions called CallRemoteFunction and CallLocalFunction. CallLocalFunction is useful if you have a callback system where you do not want to put references to all the callbacks in the code, helping to save memory.
What CallRemoteFunction does, is call public callbacks from every single loaded AMX. Imagine it as the reason why OnPlayerDeath works. Sometimes it's better to use it instead of calling it directly because it helps make libraries more flexable, etc.
|
Ok thank you westie, so it's just more flexible and better for memory usage

ps I understood the difference about CallRemoteFunction and CallLocalFunction before but thx anyways