/: server: unknown command
#1

Hello,
I have i little question.

I use this for OnPlayerCommandText:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        //lots of commands
	return SendClientMessage(playerid, 0xFF0000AA, "[SERVER]{FFFFFF} unknown command");
}
So when i use a command that doesn't exists like /bla it sais:
[SERVER] unknown command

BUT when i just enter '/' it sais the default:
SERVER: Unknown command.

I've tested this on other server with custom unknown command messages, and it also happens there.
Anyone knows how to get around this?
Reply
#2

SA:MP bug I guess. I fixed it like so:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strlen(cmdtext) < 2) return SendClientMessage(playerid, 0xFF0000AA, "[SERVER]{FFFFFF} unknown command");

    // Commands etc.
   
    return SendClientMessage(playerid, 0xFF0000AA, "[SERVER]{FFFFFF} unknown command");
}
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
SA:MP bug I guess. I fixed it like so:

-code-
Thx man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)