CallLocalFunction
#1

Just wanted to know if this can crash server or not.

Код:
new timer,startedmaps;

OnGamemodeInit
{
timer = SetTimer("antich", 5000, true);
startedmaps = 1;
return 1;
}

forward antich();

public antich()
{
if(startedmaps == 1) {CallLocalFunction("OnMapUpdate","i");}
foreach (Player,i)
{
// anticheats here
}
return 1;
}

function OnMapUpdate ()
{
// checking map seconds

return 1;
}
I was curious as it says "CallLocalFunction crashes the server if it's passing an empty string." on samp wiki: https://sampwiki.blast.hk/wiki/CallLocalFunction

Clearly I am not passing any string in that function so will it possibly crash ?

Also Is the function passing globally? since I made the variable and timer global
Reply
#2

Not sure why you would use CallLocalFunction in the first place since a) you know it exists and b) you know its name. CallLocalFunction is really only useful if you have a string input from a user that you want to use as a function name. ZCMD uses this to look for commands.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Not sure why you would use CallLocalFunction in the first place since a) you know it exists and b) you know its name. CallLocalFunction is really only useful if you have a string input from a user that you want to use as a function name. ZCMD uses this to look for commands.
Thanks for info! I'll probably make it public function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)