SA-MP Forums Archive
Server doesent recognize commands? - 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)
+--- Thread: Server doesent recognize commands? (/showthread.php?tid=460333)



Server doesent recognize commands? - Lant - 28.08.2013

I have LA-RP edit, and I changed a few things (Dont know what caused it).
And now my server says Unknown Command everytime I type something, where should I start looking for the problem


Re: Server doesent recognize commands? - ThePhenix - 28.08.2013

OnPlayerCommandText


Re: Server doesent recognize commands? - MoshuLabs - 28.08.2013

I know this may sound stupid(I've done this before), I've been editing the wrong gamemode which didn't have the coding I'd been putting in. Make sure you're loading the correct .pwn file in the config file.


Re: Server doesent recognize commands? - EiresJason - 28.08.2013

'Unknown Server Command' returns if you have return 0; in a command;
pawn Код:
return 0;
To fix it; press CTRL+F and then type in the command. Go to the 'return 0;' and change it too 1.

Example of how return 0 and return 1 work:

pawn Код:
//(Using ZCMD)
//This command would return "Unknown Server Command" if used. The message would still send though; it would just send "Unknown Server Command" directly after it.
CMD:hithere(playerid, params[])
{
   SendClientMessage(playerid, -1, "Why hello!");
   return 0;
}
This command wouldn't send you "Unknown Server Command";
pawn Код:
CMD:hithere(playerid, params[])
{
   SendClientMessage(playerid, -1, "Why hello!");
   return 1;
}
But like someone said above; if it happens everytime you talk with the default chat; just CTRL+F, search OnPlayerText and change the return 0 to return 1.


Re: Server doesent recognize commands? - Lant - 28.08.2013

It happens on EVERY command...


Re: Server doesent recognize commands? - Wizza - 28.08.2013

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
'Unknown Server Command' returns if you have return 0; in a command;
pawn Код:
return 0;
CMD:hithere(playerid, params[])
{
SendClientMessage(playerid, -1, "Why hello!");
return 0;
}
[/pawn]

This command wouldn't send you "Unknown Server Command";
pawn Код:
CMD:hithere(playerid, params[])
{
   SendClientMessage(playerid, -1, "Why hello!");
   return 1;
}
But like someone said above; if it happens everytime you talk with the default chat; just CTRL+F, search OnPlayerText and change the return 0 to return 1.
Look for what he said. return 0; and return 1; is different.


Re: Server doesent recognize commands? - Konstantinos - 28.08.2013

Use only one command processor; for example, do not use ZCMD and dcmp together.