SA-MP Forums Archive
CallLocalFunction crash - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: CallLocalFunction crash (/showthread.php?tid=215086)



CallLocalFunction crash - Blacklite - 22.01.2011

Can anyone see a problem with this? The server always crashes on the line with CallLocalFunction...

pawn Код:
if (strlen(full_cmd) > 0) {
    format(full_cmd, sizeof(full_cmd), "cmd_%s", full_cmd);
    if (IsPlayerConnected(playerid) && funcidx(full_cmd) != -1) {
        if (strcmp("NULL", extravars) == 0) {
            format(extravars, sstrlen(extravars), "");
        }
        printf("#%d %s(%d, %s)", funcidx(full_cmd), full_cmd, playerid, extravars);
        if (!CallLocalFunction(full_cmd, "is", playerid, extravars)) {
            SendClientMessage(playerid, RED, "Invalid command. Type /cmds to see a list of available commands.");
        }
        printf("#%d %s(%d, %s) executed!", funcidx(full_cmd), full_cmd, playerid, extravars);
    }
}
The last line of output is ALWAYS:

Код:
[10:15:16] #275 cmd_time(16, )
(the function changes depending on which one I am trying to call)


Re: CallLocalFunction crash - Stylock - 22.01.2011

Calling a function with an empty string causes the crash.
pawn Код:
CallLocalFunction("func", "s", ""); // = crash



Re: CallLocalFunction crash - Blacklite - 23.01.2011

Quote:
Originally Posted by YJIET
Посмотреть сообщение
Calling a function with an empty string causes the crash.
pawn Код:
CallLocalFunction("func", "s", ""); // = crash
Ah I saw something about this somewhere I think... Thanks!