SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/05/2012, 08:55 AM   #1
bleedis
Big Clucker
 
bleedis's Avatar
 
Join Date: Jan 2012
Posts: 115
Reputation: 5
Default How to change SERVER: Unknown command

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!
bleedis is offline   Reply With Quote
Old 14/05/2012, 09:01 AM   #2
Niko_boy
High-roller
 
Niko_boy's Avatar
 
Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,338
Reputation: 138
Default Re: How to change SERVER: Unknown command

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.
__________________
nope[IMG]http://*******/1r0SOkH_[/IMG]
•••[CLOSED]LCS•Freeroam•DM•Stunts•••AutoArena [0.3z][No SkinShot][sixtytiger.com]Want a decent Attack Defend Gamemode?
N/A176.31.229.148:7830Get This! Attack-Defend(v2.3.1)
Niko_boy is offline   Reply With Quote
Old 14/05/2012, 09:02 AM   #3
Pinguinn
Huge Clucker
 
Join Date: Aug 2011
Location: The Netherlands
Posts: 314
Reputation: 34
Default Re: How to change SERVER: Unknown command

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
Pinguinn is offline   Reply With Quote
Old 14/05/2012, 09:07 AM   #4
bleedis
Big Clucker
 
bleedis's Avatar
 
Join Date: Jan 2012
Posts: 115
Reputation: 5
Default Re: How to change SERVER: Unknown command

Thank u!
bleedis is offline   Reply With Quote
Old 10/01/2015, 02:07 PM   #5
aCloudy
Big Clucker
 
Join Date: Apr 2014
Posts: 188
Reputation: 2
Default Re: How to change SERVER: Unknown command

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.");
}
aCloudy is offline   Reply With Quote
Old 10/01/2015, 02:12 PM   #6
HY
Gangsta
 
HY's Avatar
 
Join Date: Sep 2014
Location: România.
Posts: 540
Reputation: 87
Default Re: How to change SERVER: Unknown command

Thanks for bumping an 3 years topic.

@aCloudy.
__________________
hi.
HY is offline   Reply With Quote
Old 10/01/2015, 02:26 PM   #7
Rog
Huge Clucker
 
Rog's Avatar
 
Join Date: Nov 2014
Location: Pakistan
Posts: 215
Reputation: 38
Default Re: How to change SERVER: Unknown command

lol :P
__________________

Looking for active staff members, interested join : cod-aw.com


Rog is offline   Reply With Quote
Old 10/01/2015, 02:34 PM   #8
aCloudy
Big Clucker
 
Join Date: Apr 2014
Posts: 188
Reputation: 2
Default Re: How to change SERVER: Unknown command

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 ?
aCloudy is offline   Reply With Quote
Old 10/01/2015, 02:41 PM   #9
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: How to change SERVER: Unknown command

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.
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 05/05/2015, 06:20 AM   #10
Godde
Little Clucker
 
Join Date: Dec 2014
Location: Im Lost!...
Posts: 40
Reputation: 2
Talking Re: How to change SERVER: Unknown command

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
Godde is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change SERVER: Unknown command +REP TheMightyEddy Scripting Help 8 07/04/2012 08:10 PM
Executed ZCMD command returns SERVER: Unknown Command SexTourist Scripting Help 12 03/01/2012 04:38 PM
Change SERVER: UNKNOWN COMMAND Chrillzen Help Archive 5 06/08/2011 08:15 PM
Unknown command message change LZLo Help Archive 6 04/06/2011 03:34 PM
How can i change SERVER: UNKNOWN COMMAND? Ihsan_Cingisiz Help Archive 1 19/05/2010 09:42 PM


All times are GMT. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.