"Unknown Command" Error for Known Command..
#1

Hello guys!..I've problem with my new mode.

I made a "/clanname1 [1st clan's name]" command.It is for select 1st clan's name for clan matches.But in game , this command gives the "Unknown Command" error.

Here the codes :

pawn Код:
if(strcmp(cmdtext, "/clanname1", true) == 0)
    {
              tmp = strtok(cmdtext, idx);
  if(strlen(tmp) > 7)
     SendClientMessage(playerid, 0xFF0000AA, "You can set <7 character for clan name.");
 else if(!strlen(tmp)) SendClientMessage(playerid, 0xFF0000AA, "USAGE: /clanname1 [1st clan's name]");
else    if(clannames[playerid]==false) SendClientMessage(playerid, 0xFF0000AA, "ERROR: You must select 'Clan Names' from clan match menu.");
else   if(strlen(tmp) && strlen(tmp) < 3 && clannames[playerid]==true && IsPlayerAdmin(playerid))
    {
    format(string, sizeof(string), "%s",tmp);
        SendClientMessage(playerid,0x554466AA,"Now..Write The Second Clan's Name.");
        clannames2[playerid] = true;
        clannamesselect = string;
        clannames[playerid]=false;
}
return 1;
        }
I'm waiting ur helps..Thanks.
Reply
#2

I don't know if it's just copying a script to the forums that causes this problem but the indentations are a bit messed up, and it makes it harder to interpret what the problem is!
Reply
#3

Quote:
Originally Posted by Weirdosport
I don't know if it's just copying a script to the forums that causes this problem but the indentations are a bit messed up, and it makes it harder to interpret what the problem is!
I think returns make this error.But I can't find the wrong in them.
Anyone can help for returns ?
Reply
#4

i havent red your code, but to me your problem sounds excisting of a out of array variable, or using a function with an invalid variable;

if you have any loops, check the size of the variable used , which should be an array, is big enough for the loop

note that return 0; ISNT required for getting this message, also for failing codes;
so for example in a out of array loop, it will return 0; automaticly
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)