01.07.2013, 18:17
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.
}