SA-MP Forums Archive
Unknown Command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Unknown Command (/showthread.php?tid=151264)



Unknown Command - Nonameman - 29.05.2010

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


Re: Unknown Command - (SF)Noobanatior - 29.05.2010

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



Re: Unknown Command - Nonameman - 30.05.2010

ohh, thanks a lot


Re: Unknown Command - Nonameman - 30.05.2010

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?


Re: Unknown Command - oNx - 30.05.2010

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


Re: Unknown Command - Nonameman - 30.05.2010

delete