Unknown Command
#1

Hello,
I've made SOME cmds with STRCMP because ZCMD doesnt load to me,I went IG to test them and they said"Unknown Command"
Reply
#2

Make sure it returns 1;
example using ZCMD (regular strcmp is the same)
pawn Код:
CMD:example(playeris, params[])
{
    SendClientMessage(playerid, -1, "This is a example");
    return 1;//add this
}
if I remember correctly with strcmp command you need to do return 1; and return 0; at the last bracket aswell.
example from samp wiki:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3))
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(0xFFFF00AA, str);
        return 1;//returning 1 for each command code
    }
    if(!strcmp(cmdtext, "/example", true, 3)) //our zcmd command in strcmp
    {
        SendClientMessage(playerid, -1, "This is a example");
        return 1;//returning 1 for each command code
    }
    return 0;//returning 0 for the last bracket
}
Reply
#3

Could you post the code, please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)