"SERVER: Unknown command."
#7

Quote:
Originally Posted by Dubya
Посмотреть сообщение
ok well.. ZCMD is better.
True;

phillip875: The OnPlayerCommandText callback returns 0 not 1;

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/kill", cmdtext, true, 10) == 0)
    {
        SetPlayerHealth (playerid, 0);
        SendClientMessage (playerid, 0x4D34B3FF, "You have killed yourself, idiot.");
        return 1;
    }
    return 0;// it should be 0 not 1..
    // 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.
 }
Wiki: https://sampwiki.blast.hk/wiki/OnPlayerCommandText

Regards,
FalconX
Reply


Messages In This Thread
"SERVER: Unknown command." - by daimon567 - 09.08.2012, 23:33
Re: "SERVER: Unknown command." - by phillip875 - 09.08.2012, 23:36
Re: "SERVER: Unknown command." - by daimon567 - 09.08.2012, 23:36
Re: "SERVER: Unknown command." - by daimon567 - 09.08.2012, 23:38
Re: "SERVER: Unknown command." - by phillip875 - 09.08.2012, 23:38
Re: "SERVER: Unknown command." - by Dubya - 09.08.2012, 23:39
Re: "SERVER: Unknown command." - by FalconX - 09.08.2012, 23:42
Re: "SERVER: Unknown command." - by daimon567 - 09.08.2012, 23:47
Re: "SERVER: Unknown command." - by FalconX - 09.08.2012, 23:53
Re: "SERVER: Unknown command." - by daimon567 - 10.08.2012, 00:08
Re: "SERVER: Unknown command." - by grand.Theft.Otto - 10.08.2012, 00:33
Re: "SERVER: Unknown command." - by daimon567 - 10.08.2012, 00:53

Forum Jump:


Users browsing this thread: 2 Guest(s)