SA-MP Forums Archive
How to change SERVER: 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)
+--- Thread: How to change SERVER: Unknown command (/showthread.php?tid=342567)



How to change SERVER: Unknown command - bleedis - 14.05.2012

Heyaa!
Can someone can tell me how to change that someone typed an unknown command it will not show as "SERVER: Unknown command" but whatever different text in example "You`re not a harry poter to make your own commands."
Thanks!


Re: How to change SERVER: Unknown command - Niko_boy - 14.05.2012

pawn Code:
public OnPlayerCommandText(playerid,cmdtext[])
{
 //---- all commands
  return 0;
}
down there it is return 0 make it
pawn Code:
return SendClientMessage(playerid,-1,"Invalid COmmand");


So it returns That message where " -1 " is color you want , and Replace Invalid Command by message you want.


Re: How to change SERVER: Unknown command - Pinguinn - 14.05.2012

Replace
pawn Code:
return 0;
with
pawn Code:
return SendClientMessage(playerid, [color], "You're not harry potter to make your own commands");
at the bottom of OnPlayerCommandText


Re: How to change SERVER: Unknown command - bleedis - 14.05.2012

Thank u!


Re: How to change SERVER: Unknown command - aCloudy - 10.01.2015

This is mine.
But it still "SERVER: Unknown command"


Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    //Can't use commands when not spawned.
	if(IsSpawned[playerid] != 1)
	{
	   SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}You cannot use commands while you're not spawned.");
	   return 1;
	}

	return SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]{FFFFFF} You have entered and invalid command, Type /commands or /cmds to see our server commands.");
}



Re: How to change SERVER: Unknown command - HY - 10.01.2015

Thanks for bumping an 3 years topic.

@aCloudy.


Re: How to change SERVER: Unknown command - Rog - 10.01.2015

lol :P


Re: How to change SERVER: Unknown command - aCloudy - 10.01.2015

Quote:
Originally Posted by HY
View Post
Thanks for bumping an 3 years topic.

@aCloudy.
LOOOL :P
I ******d this, hehehe.
Can someone help me ?


Re: How to change SERVER: Unknown command - CalvinC - 10.01.2015

Very simple.
pawn Code:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, COLOR_GREY, "That command does not exist - /commands for a list of commands.");
    return 1;
}
This is what i use.


Re: How to change SERVER: Unknown command - Godde - 05.05.2015

Quote:
Originally Posted by Pinguinn
View Post
Replace
pawn Code:
return 0;
with
pawn Code:
return SendClientMessage(playerid, [color], "You're not harry potter to make your own commands");
at the bottom of OnPlayerCommandText
ahahaha, this is a funny one


Re: How to change SERVER: Unknown command - fuckingcruse - 05.05.2015

Its easy , at end in the place or return 0 type

return SendClientMessage(playerid , -1 /*you can choose your color*/ , " You are not harry potter to make your own commands! ");

That's it.. BINGO!!


Re: How to change SERVER: Unknown command - Beckett - 05.05.2015

Quote:
Originally Posted by HY
View Post
Thanks for bumping an 3 years topic.

@aCloudy.
You are allowed to bump a topic which hasn't been archived and you are facing the same error.


ontopic: Replace the return 0 with the message you want to send.


Re: How to change SERVER: Unknown command - KizZweLL - 22.06.2017

Sorry for bumping the topic.
But I did what you guys talking about but still it sends me SERVER:Unknown Command.

It worked from my past scripts idk why it won't work now.
is this a update bug?


Re: How to change SERVER: Unknown command - JasonRiggs - 22.06.2017

Why not start a new thread instead of Bumping a 5 years old thread?? Although, It differs from a script to another, Some scripts needs you to create a new unknown command stock..


Re: How to change SERVER: Unknown command - Astralis - 22.06.2017

Quote:
Originally Posted by KizZweLL
View Post
Sorry for bumping the topic.
But I did what you guys talking about but still it sends me SERVER:Unknown Command.

It worked from my past scripts idk why it won't work now.
is this a update bug?
pawn Code:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
      new str[200];
      if(strlen(cmdtext) < 20) format(str,sizeof(str),"The command %s is not available. Try /cmds instead.",cmdtext);
      else format(str,sizeof(str),"This command is not available, try /cmds instead.");
      PlayerPlaySound(playerid,5204 ,0.0,0.0,0.0);
      return SendClientMessage(playerid,-1,str);
    }
    return 1;
}



Re: How to change SERVER: Unknown command - DutchDailySmoker - 21.05.2018

How to make it so it will only respond to commands which are not in use? For instance I have /help but when I used /help it still shows the message now. I want it to show only for commands which or not in use. Anyone?