Command added but returns Unkown 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: Command added but returns Unkown command (
/showthread.php?tid=109360)
Command added but returns Unkown command -
hipy - 19.11.2009
Hi
i added a command but for some reason it keeps saying it doesnt know the command
already tried doing return 1 everywhere, etc.
all other commands work fine. The position in the script doesnt bother
pawn Код:
if(!strcmp(cmdtext, "/join", true))
{
if(playercount >= 3)
{
dm[playerid] = 1;
}
else
{
dm[playerid] = 0;
spectate(playerid);
}
return 1;
}
edit: blag ignore the indentation
Re: Command added but returns Unkown command -
yom - 19.11.2009
Nothing wrong in that code, unless your dm array size is not at least the value of playerid (which is unlikely if you are alone in your server..), or some bugs in your spectate function maybe.
Re: Command added but returns Unkown command -
ExoSanty - 19.11.2009
shouldn't it be more like
if (strcmp("/join", cmdtext, true, 5) == 0)
Re: Command added but returns Unkown command -
Calon - 19.11.2009
Quote:
Originally Posted by ExoSanty
shouldn't it be more like
if (strcmp("/join", cmdtext, true, 5) == 0)
![smiley](images/smilies/question.gif)
|
You don't have to define the string size, it's optional. Sorry, this is all I have to contribute to this topic.