Annoying Command Problem
#1

Hello, Well I have one annoying problem that same looking commands can be fcuked up. What I mean? Well for example I want to preform a animation I called /gasko, when im doing it I got another command coming out instead of the anim the command is /ganton (info list), I do know that it happends because of the first same 2 letters in each command and I do know that I can fix it by renaming one of the commands, But is there some other way to fix it, I mean even for example I have another info list that is called /lspd, if I will type /lspb it will still show the /lspd info thing, so sometimes it annoys. Could someone tell me if there is a way to fix it.

-Thank You.
Reply
#2

I guess you are using strcmp. If so delete number in its line.
Ex.
PHP код:
if(!strcmp("/lspd",cmdtext,true,5)) //delete 5 
Reply
#3

pawn Код:
if (strcmp("/mycommand", cmdtext, false, 10) == 0)//and replace 10 with the number of caracters from ""
{
// Do something here
return 1;
}
I don't know if it will work
Reply
#4

Thank you Dimi, I tested it worked, lets hope it will continue working like this
Reply
#5

Quote:
Originally Posted by eDz0r
Посмотреть сообщение
pawn Код:
if (strcmp("/mycommand", cmdtext, false, 10) == 0)//and replace 10 with the number of caracters from ""
{
// Do something here
return 1;
}
I don't know if it will work
Exactly what I said NOT to do. Number is optional and means "how many characters from command to match with given word?". Ex.
PHP код:
if(!strcmp("/mycommand",cmdtext,true1)) 
here we gave instruction to match only 1 character so any command that contains / m y c o a n or d which is every command coz you have / in /mycommand.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)