About "SERVER: Unknown Command"
#1

There are a few ways I know about, which can cause "SERVER: Unknown Command". There are some, which even stop the game mode working. One, is if you do something like this:

pawn Код:
new something[32];
print(something[32]);
Which, will cause a crash, because [32] is of course, the 33rd cell in the array, which doesn't exist.

The only other thing I know which can cause "SERVER: Unknown Command" is the classic "return 0;" on commands.

I am having some problems on my server. Sometimes, this unknown command thing starts happening for all commands, and the whole game mode stops working. I have to do /rcon gmx to fix it. This is a pain in the ass. What's even worse, is that some know-it-all hacker seems to have found a way to cause this on cue, and he can crash my server any time he wants, if he can get around my range bans.

Basically, I want to know if anyone else has any info on what causes "SERVER: Unknown Command", and any ways to fix it. I have a 30k line script, I have no idea where to start looking.

Thanks
Blacklite
Reply
#2

Just return 1; after every command ends
Reply
#3

Quote:
Originally Posted by dice7
Just return 1; after every command ends
That's not the problem.
Reply
#4

If u used TeleMaker to learn strcmp lemme tell you the format is wrong, so the cmds werk, but appears Server unknown command
Reply
#5

Quote:
Originally Posted by argon
If u used TeleMaker to learn strcmp lemme tell you the format is wrong, so the cmds werk, but appears Server unknown command
No, that's not the problem either. I know how to use strcmp, and I used dcmd for commands, anyway.
Reply
#6

It's a strval bug, when you exceed 50 chars in the command.
Reply
#7

I thought strval crashed your script when it was overflowed?

But I've had this happen before when I accidentally made an enum try and get a value from playerid -1. It did not crash my server, it gave me a "SERVER: Unknown Command" message.
Reply
#8

afaik the strval bug leaves your server in a state of limbo. The basic SA-MP server works, but the pawn runtime doesn't.
Reply
#9

Quote:
Originally Posted by kc
afaik the strval bug leaves your server in a state of limbo. The basic SA-MP server works, but the pawn runtime doesn't.
I was just about to ask another question and you answered it. Thanks very much, I will look into it.

EDIT: Would this work:

pawn Код:
sstrval(str[])
{
    if (strlen(str) > 16) return -1;
    return strval(str);
}
Don't worry about it returning -1, the script should just treat it as though the user typed -1, which is an invalid option for everything.

EDIT2: It works! Yay!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)