Unknown command [Advanced]
#1

Hello,
I'm receiving an error : Server: Unknown command.
when using this command :
Код:
	if(strcmp("/me", cmd[0], true, 10) == 0)
	{
		new string2[1024];
		format(string2, sizeof(string2), cmdtext);
		strdel(string2, 0, 3);
	    format(string, sizeof(string), "* %s%s", pName(playerid), string2);
	    ProxDetector(20.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	    return 1;
	}
I'm sure this is not a return 1; error because I checked it.
Can you please give me all the possible causes of this message ? because I'm receiving it a lot and it's not about the returns.
Reply
#2

Код:
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        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]);
        ProxDetector(20.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
        SendClientMessageToAll(0xFFFF00AA, str);
        return 1;
 }
Reply
#3

Use ZCMD, its fast and easy to use.
Reply
#4

You are probably using two command processor at once (e.g: ZCMD and strcmp)?
Reply
#5

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
You are probably using two command processor at once (e.g: ZCMD and strcmp)?
The issue is not that, it is exactly what PinEvil said, the same thing I thought when I just read the code.

Quote:
Originally Posted by PinEvil
Посмотреть сообщение
Код:
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        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]);
        ProxDetector(20.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
        SendClientMessageToAll(0xFFFF00AA, str);
        return 1;
 }
Reply
#6

Actually guys, the problem is solved when I remove this line : "strdel(string2, 0, 3);"
Reply
#7

Anybody ?
Reply
#8

pawn Код:
if(strcmp("/me", cmdtext, true) == 0)
    {
        new string2[128];
        format(string2, sizeof(string2), cmdtext[4]);
        format(string, sizeof(string), "* %s %s", pName(playerid), string2);
        ProxDetector(20.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)