CallLocalFunction crash
#1

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)
Reply
#2

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

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)