SERVER: Unknown Command
#1

Hello,

I would like that if a player writes a command that doesn't exist on my server that they recieve my custom message like:

"Oops, you have typed in a wrong command. Use /cmds to see all of the commands"

And not the standard sa-mp way:

SERVER: Unknown command.

I saw it on a couple of servers so i know it's possible but i don't know how to make it.

Thank you for your answers.
Reply
#2

If you use ZCMD you can use:

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(success == 0)
    {
      SendClientMessage(playerid, red, "SERVER: You have entered an Unknown Command.");
      return 1;
    }
    return 1;
}
Reply
#3

Thanks.
Reply
#4

Or do it like this

At the last of OnPlayerCommandText , there is return 0;
Change it to this
pawn Код:
return SendClientMessage(playerid,COLOR,"Oops, you have typed in a wrong command. Use /cmds to see all of the commands");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)