About "SERVER: Unknown Command" -
Blacklite - 11.07.2009
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
Re: About "SERVER: Unknown Command" -
dice7 - 11.07.2009
Just return 1; after every command ends
Re: About "SERVER: Unknown Command" -
Blacklite - 11.07.2009
Quote:
Originally Posted by dice7
Just return 1; after every command ends
|
That's not the problem.
Re: About "SERVER: Unknown Command" -
argon - 11.07.2009
If u used TeleMaker to learn strcmp lemme tell you the format is wrong, so the cmds werk, but appears Server unknown command
Re: About "SERVER: Unknown Command" -
Blacklite - 12.07.2009
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.
Re: About "SERVER: Unknown Command" -
Danny_Costelo - 12.07.2009
It's a strval bug, when you exceed 50 chars in the command.
Re: About "SERVER: Unknown Command" -
ledzep - 12.07.2009
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.
Re: About "SERVER: Unknown Command" -
kc - 12.07.2009
afaik the strval bug leaves your server in a state of limbo. The basic SA-MP server works, but the pawn runtime doesn't.
Re: About "SERVER: Unknown Command" -
Blacklite - 12.07.2009
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!