Unknown Command
#1

Hello!

I want to change the "Unknown Command" message when someone writes a bad command text into the chat. The message i want the server to write is "There is no command like your <the bad command>, try /commands to find the command you wanted to use". Please reply if you know how can i make it.

Thanks
Nonameman
Reply
#2

at the bottom of OnPlayerCommandText change return 0; to return 1; the will get rid of UNKNOWN COMMAND and then just format a msgs jus above that
pawn Код:
new str[128];
format(str,sizeof(str),"There is no command like your <%s>",cmdtext);
SendCilentMessage(playerid,colour,str);
or
pawn Код:
new str[128];
if(str[0] == /) { //only for commands that start with "/"
format(str,sizeof(str),"There is no command like your <%s>",cmdtext);
SendCilentMessage(playerid,colour,str);
return 1;
}
else return 0; //unknown command
Reply
#3

ohh, thanks a lot
Reply
#4

I got this error message

C:\Documents and Settings\...\filterscripts\myfs.pwn(173) : error 029: invalid expression, assumed zero

to the line

if(str[0] == /) {

i tried to rewrite it to

if(strcmp(string[0], "/")) {

and now the compiler wrote no errors, is it good now?
Reply
#5

he gave you 2 ways to do this use the other one
Reply
#6

delete
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)