"Unknown Command" shows even when command works?
#1

i edited another /help code and now when I do /help or /pcmds (Which shows some cmds) it shows the cmds but it also shows "Unknown command" even though it works.

CODE:

pawno
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/help", true))
{
SendClientMessage(playerid, 0xCC0000AA, "BLAHBLAH");
SendClientMessage(playerid, 0xCC0000AA, "---------------------------------------------------------");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
}
if(!strcmp(cmdtext, "/pcmds", true))
{
SendClientMessage(playerid, 0xCC0000AA, "SERVER: List of commands for Police");
SendClientMessage(playerid, 0xCC0000AA, "---------------------------------------------------------");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "TBLAHBLAH");
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
}
return SendClientMessage(playerid,-1,"This command doesn't exist - Use /help or contact an admin");
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}
Reply
#2

Where are the returns?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/help", true))
{
SendClientMessage(playerid, 0xCC0000AA, "BLAHBLAH");
SendClientMessage(playerid, 0xCC0000AA, "---------------------------------------------------------");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
return 1;
}
if(!strcmp(cmdtext, "/pcmds", true))
{
SendClientMessage(playerid, 0xCC0000AA, "SERVER: List of commands for Police");
SendClientMessage(playerid, 0xCC0000AA, "---------------------------------------------------------");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "BLAHBLAH");
SendClientMessage(playerid, 0xAFAFAFAA, "TBLAHBLAH");
return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
}
return SendClientMessage(playerid,-1,"This command doesn't exist - Use /help or contact an admin");
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}
Reply
#3

tah dude
Reply
#4

What? -.-
Reply
#5

tah = thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)