Unknown Command
#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


Messages In This Thread
Unknown Command - by [SU]Spartan - 07.01.2014, 10:07
Re: Unknown Command - by Voxel - 07.01.2014, 10:21
Re: Unknown Command - by offon - 07.01.2014, 12:09

Forum Jump:


Users browsing this thread: 1 Guest(s)