Why does it say unknown command?
#4

Your code's a mess.
pawn Код:
if (strcmp("/gotolp", cmdtext, true, 10) == 0) {
    if(IsPlayerAdmin(playerid)) { // Open bracket that you forgot.
        SendClientMessage(playerid,YELLOW, "(INFO) You have been teleported to Las Payasadas!");
        SetPlayerPos(playerid,-247.7184,2692.8208,62.6875);
        // The "return 1;" was needless since you are calling "return 1;" after the else statement, therefore you're calling the "return" function twice, causing the other return to be unreachable. Returning a true value in OnPlayerCommandText stands for a successfully executed command. Once is enough.
    }
    else { // You should put an opening bracket here.
        SendClientMessage(playerid,YELLOW, "(INFO) This command is for administrators only!");
    } // This is a closing bracket, not an opening one.
    return 1;
}
Reply


Messages In This Thread
Unreachable code, help. - by BigGroter - 11.11.2011, 16:45
Re: Why does it say unknown command? - by Calgon - 11.11.2011, 16:46
Re: Why does it say unknown command? - by BigGroter - 11.11.2011, 16:52
Re: Why does it say unknown command? - by Mean - 11.11.2011, 18:07
Re: Why does it say unknown command? - by Chrillzen - 11.11.2011, 18:08

Forum Jump:


Users browsing this thread: 1 Guest(s)