Server: Unknown Command
#1

I'm having this issuse, When I type a command like /credits it gives me the credits of who made this script, so the cmd works fine, but it also says, SEVER: UNKNOWN COMMAND, but it is a known command, so how can i fix it?
Reply
#2

Make sure you return something. In most cases:
pawn Код:
return 1;
Reply
#3

show the script
Reply
#4

Use Zcmd or Dcmd
Reply
#5

Show the command code.
Reply
#6

This is when the problem happens:
pawn Код:
if( !strcmp( cmdtext, "/somecommand", true, 12 ) )
{
    SendClientMessage( playerid, 0xAAAAAA, "Hi" );
}
See, you aren't returning anything, so it just skips to the "return 0" in OnPlayerCmdtext.
So correct would be
pawn Код:
if( !strcmp( cmdtext, "/somecommand", true, 12 ) )
{
    SendClientMessage( playerid, 0xAAAAAA, "Hi" );
    return 1; // You need to put this in every command
}
Or you can put return in front of your last function ( note: not all the time ) :
pawn Код:
if( !strcmp( cmdtext, "/somecommand", true, 12 ) )
{
    return SendClientMessage( playerid, 0xAAAAAA, "Hi" );
}
Hope I helped.

Cheers!
-Mean.
Reply
#7

Thanks! I managed to fix it.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)