"Unknown Command" Error for Known Command.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: "Unknown Command" Error for Known Command.. (
/showthread.php?tid=68904)
"Unknown Command" Error for Known Command.. -
Myr4c3 - 14.03.2009
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.
Re: "Unknown Command" Error for Known Command.. -
Weirdosport - 14.03.2009
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!
Re: "Unknown Command" Error for Known Command.. -
Myr4c3 - 14.03.2009
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 ?
Re: "Unknown Command" Error for Known Command.. -
maij - 14.03.2009
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