Error message
#1

How to set " ERROR: Unknown command!" when the player enters the wrong command to " That command doesn't exist! Use /help to see available commands!"
Reply
#2

Use OnPlayerCommandPerformed and do:

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) SendClientMessage(playerid, -1, "SERVER: You have entered an unknown command! Use /help to see avaliable commands!");
return 1;
}

It will also send this message if the command returns 0 which can be used to trick them into thinking the command they entered doesn't exist. Anyway, there you go. If I helped you it wouldn't hurt to REP me. If you don't want to REP me, at-least say thanks!

- Abagail
Reply
#3

For ZCMD:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success) return SendClientMessage(playerid, -1, " That command doesn't exist! Use /help to see available commands!");
    return 1;
}
For strcmp:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    // commands..

    return SendClientMessage(playerid, -1, " That command doesn't exist! Use /help to see available commands!");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)