SA-MP Forums Archive
"Unknown Command" shows even when command works? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: "Unknown Command" shows even when command works? (/showthread.php?tid=447783)



"Unknown Command" shows even when command works? - Nines - 01.07.2013

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.
}



Re: "Unknown Command" shows even when command works? - Necip - 01.07.2013

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.
}



Re: "Unknown Command" shows even when command works? - Nines - 01.07.2013

tah dude


Re: "Unknown Command" shows even when command works? - Necip - 01.07.2013

What? -.-


Re: "Unknown Command" shows even when command works? - Nines - 01.07.2013

tah = thanks