"Unknown Command" shows even when command works?
#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


Messages In This Thread
"Unknown Command" shows even when command works? - by Nines - 01.07.2013, 18:09
Re: "Unknown Command" shows even when command works? - by Necip - 01.07.2013, 18:17
Re: "Unknown Command" shows even when command works? - by Nines - 01.07.2013, 18:23
Re: "Unknown Command" shows even when command works? - by Necip - 01.07.2013, 18:25
Re: "Unknown Command" shows even when command works? - by Nines - 01.07.2013, 19:03

Forum Jump:


Users browsing this thread: 3 Guest(s)