cmds always wrong
#1

every time i type a command the command works, but then it says unknown command.

all the returns are there, all the code is fine. what could be causing this?
Reply
#2

i'm getting that thing to on the command /enter i think it was because i scripted to press F is the same as /enter
Reply
#3

Be sure every function in de commands returns 1. If it is returning 0, it will say Unknown command...
Reply
#4

there are no return 0's.

see code here
http://pastebin.com/d1aa7ef1a
Reply
#5

1) Return 0 not 1 at the end of OnPlayerCommandText and your problem should be fixed
2) Make commands like
pawn Код:
if(strcmp(cmdtext, "/mycommand", true, 3)==0)
into
pawn Код:
if(strcmp(cmdtext, "/mycommand", true)==0)
Reply
#6

ivve done all of this, and im still having this retarded problem..
Reply
#7

at then end of every command add
pawn Код:
return 1;
Reply
#8

Here is an example, think it'll work ^^:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);     // <== If u have strtok, u don't need tu compare "/speedo" with cmdtext, just with cmd.
 
    if(!strcmp(cmd, "/speedo", true))
    {
      if(SpeedoToggle[playerid] == false)
      {
        SpeedoToggle[playerid] = true;
        SendClientMessage(playerid, 0xFFFF00FF, "Speedo toggled on.");
      }
      else
      {
        SpeedoToggle[playerid] = false;
        SendClientMessage(playerid, 0xFFFF00FF, "Speedo toggled off.");
      }
      return 1;
    }
    return 0;
}
Reply
#9

He said it happens only at known commands, not at unknown commands.
Be sure you return every command.


Quote:
Originally Posted by Shellegg
i'm getting that thing to on the command /enter i think it was because i scripted to press F is the same as /enter
Oh'rly? You scripter? Nice.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)