Why does it say unknown command?
#2

You need to return 1 inside the command. Return 0 is sent otherwise, and if 0 is sent, SA-MP is told to relay the 'unknown command' message.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp("/test", cmdtext, true) == 0) {
      if(IsPlayerAdmin(playerid)) {
         SendClientMessage(playerid, 0xFF00FFFF, "test1");
      }
      else
      {
         SendClientMessage(playerid, 0xFF00FFFF, "test2");
      }

      return 1;
   }

   return 0;
}
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)