I don't have "Unknow command"
#1

Hello, all is in the title. When I type a command (for example, /erphigeih), I don't have any error message.

How can I make a error message, for example : "Unknow command, type /cmds to have a list of the commands" ?

Thanks =)
Reply
#2

Like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return SendClientMessage(playerid, color, "Unknow command, type /cmds to have a list of the commands");
}
Reply
#3

I use DCMD commands. Will it work ?
Reply
#4

Just change the return 0; near the end of OnPlayerCommandText to

pawn Код:
return SendClientMessage(playerid, color, "Unknow command, type /cmds to have a list of the commands");
Like xRyder said and it will work.
Reply
#5

ZCMD:

pawn Код:
public OnCommandPerformed(playerid, cmdtext, success)
{
    if(!success) return SendClientMessage(playerid, -1, "Not a command, /help");
    return 1;
}
Forgot the parameters but shouldd work..
Reply
#6

Thanks to all, I will try this
Reply
#7

Thx, it work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)