SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 30/03/2019, 10:40 PM   #1
Grumbles
Little Clucker
 
Join Date: Oct 2012
Location: USA, New York
Posts: 39
Reputation: 0
Default About the wrong command

Hello guys,

For example, I used the command '/ test'. However, the server has '/ testing' command. How can I list similar commands instead of "SERVER: Unknown Command"?

The message that should come out is: "Incorrect command entered. Similar to: / testing"

I don't know how to do it. I'm waiting for your help.

Regards.
Grumbles is offline   Reply With Quote
Old 30/03/2019, 11:04 PM   #2
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,192
Reputation: 420
Default Re: About the wrong command

You'd literally have to make a /test command that would refer back to /testing (which is useless) that's why some cmd includes give you the option of creating an alias, other names for the same command.
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 31/03/2019, 02:10 AM   #3
Grumbles
Little Clucker
 
Join Date: Oct 2012
Location: USA, New York
Posts: 39
Reputation: 0
Default Re: About the wrong command

Quote:
Originally Posted by RogueDrifter View Post
You'd literally have to make a /test command that would refer back to /testing (which is useless) that's why some cmd includes give you the option of creating an alias, other names for the same command.
Since the first three letters are similar, can't I propose this instead of the error command?
Grumbles is offline   Reply With Quote
Old 31/03/2019, 04:26 AM   #4
iorp
Big Clucker
 
iorp's Avatar
 
Join Date: Sep 2018
Location: I do not live
Posts: 65
Reputation: 1
Default Re: About the wrong command

Define the alias for your command
__________________
Indian Ocean Roleplay

iorp is offline   Reply With Quote
Old 31/03/2019, 04:27 AM   #5
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,324
Reputation: 652
Default Re: About the wrong command

Quote:
Originally Posted by Grumbles View Post
Since the first three letters are similar, can't I propose this instead of the error command?
No. This is something you'll have to implement.

Which command processor are you using? Most of the more modern ones such as SmartCMD, Pawn.CMD, or YCMD all include ways to define alias commands to do exactly what you are asking for (as RogueDrifter mentioned already).

If you are using an older one such as ZCMD, you'll need to call the other command within a completely separate command.



@"iorp"; GET THE FUCK OUT OF HERE YOU IMBECILE. THIS IS A PLACE WHERE WE TEACH PEOPLE. IT'S CALLED "SCRIPTING HELP", NOT "BULLSHIT". If you don't know how to help just don't. If you do know how to help then do that instead of commenting something dumb that's not going to help or teach anyone.
Crayder is offline   Reply With Quote
Old 31/03/2019, 04:37 AM   #6
iorp
Big Clucker
 
iorp's Avatar
 
Join Date: Sep 2018
Location: I do not live
Posts: 65
Reputation: 1
Default Re: About the wrong command

Quote:
Originally Posted by Crayder View Post
No. This is something you'll have to implement.

Which command processor are you using? Most of the more modern ones such as SmartCMD, Pawn.CMD, or YCMD all include ways to define alias commands to do exactly what you are asking for (as RogueDrifter mentioned already).

If you are using an older one such as ZCMD, you'll need to call the other command within a completely separate command.



@"iorp"; GET THE FUCK OUT OF HERE YOU IMBECILE. THIS IS A PLACE WHERE WE TEACH PEOPLE. IT'S CALLED "SCRIPTING HELP", NOT "BULLSHIT". If you don't know how to help just don't. If you do know how to help then do that instead of commenting something dumb that's not going to help or teach anyone.
Nope, If he asked me "how to make a alias" or "I do not know what the alias is", Then I will send him a complete description of the alias for the command and He can search for it on the forum. ****** once told me, We provide the information that was needed, Instead of teaching every single line of code, so fuck of
__________________
Indian Ocean Roleplay

iorp is offline   Reply With Quote
Old 03/04/2019, 02:21 AM   #7
Grumbles
Little Clucker
 
Join Date: Oct 2012
Location: USA, New York
Posts: 39
Reputation: 0
Default Re: About the wrong command

You misunderstood me. I'm not talking about alias. I don't know the name of a command. I'm just writing '/ hel'.
I want to say that the command '/ help' is on the server instead of the unknown command error.

I guess you didn't understand me for using ****** translate. XD
Grumbles is offline   Reply With Quote
Old 03/04/2019, 03:26 AM   #8
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,324
Reputation: 652
Default Re: About the wrong command

Quote:
Originally Posted by Grumbles View Post
You misunderstood me. I'm not talking about alias. I don't know the name of a command. I'm just writing '/ hel'.
I want to say that the command '/ help' is on the server instead of the unknown command error.

I guess you didn't understand me for using ****** translate. XD
Again, different command processors go about this different ways.

From my understanding you wish to display a message like "Sorry the command '/hel' doesn't exist! Did you mean '/help'?"

To do this you will need a list of all of your commands and a way to compare each command to the given input. You may even want a Levenshtein distance calculation. This will determine which command is closest to the input.

Once you have that part figured out the rest depends on what command processor you use. So, again, what command processor do you use?
Crayder is offline   Reply With Quote
Old 04/04/2019, 09:38 AM   #9
CONTROLA
Huge Clucker
 
CONTROLA's Avatar
 
Join Date: Dec 2010
Posts: 256
Reputation: 15
Default Re: About the wrong command

Quote:
Originally Posted by Crayder View Post
No. This is something you'll have to implement.
@"iorp"; GET THE FUCK OUT OF HERE YOU IMBECILE. THIS IS A PLACE WHERE WE TEACH PEOPLE. IT'S CALLED "SCRIPTING HELP", NOT "BULLSHIT". If you don't know how to help just don't. If you do know how to help then do that instead of commenting something dumb that's not going to help or teach anyone.
get a chill pill
CONTROLA is offline   Reply With Quote
Old 04/04/2019, 06:02 PM   #10
Grumbles
Little Clucker
 
Join Date: Oct 2012
Location: USA, New York
Posts: 39
Reputation: 0
Default Re: About the wrong command

Quote:
Originally Posted by Crayder View Post
Again, different command processors go about this different ways.

From my understanding you wish to display a message like "Sorry the command '/hel' doesn't exist! Did you mean '/help'?"

To do this you will need a list of all of your commands and a way to compare each command to the given input. You may even want a Levenshtein distance calculation. This will determine which command is closest to the input.

Once you have that part figured out the rest depends on what command processor you use. So, again, what command processor do you use?
Yeah, that's exactly what I mean. I'm using OnPlayerCommandText as the command client.
Grumbles 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
Help Wrong Command Hazliu Scripting Help 2 06/08/2015 12:02 PM
What's Wrong with this Command ? MCZOFT Server Support 5 10/11/2014 01:45 PM
what's wrong with this command thefatshizms Scripting Help 9 22/07/2012 09:22 AM
what's wrong with this command? Face9000 Help Archive 3 08/09/2010 03:26 PM
how i change wrong command (unknow command) OmarEco Help Archive 10 22/06/2010 04:09 PM


All times are GMT. The time now is 03:03 PM.


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