Wrong Command Text Help
#1

Okay, basically what I need help with is that I set my server up so when you do an incorrect command instead of saying "SERVER: Unknown command." it will say "No such command! Type /cmds for a list of player commands."
Here is my code (btw I'm using ZCMD):

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success) SendClientMessage(playerid, COLOR_RED, "No such command! Type /cmds for a list of player commands.");
    return 1;
}
The problem is if I do a command from a different filterscript it will give me this message and it won't do the command. So if anyone has any ideas on how to fix this, that would be great.
Reply
#2

Try CTRL+F search for SERVER: Unknown command

Replace with what you want.

Works for me. also, you've to put that into every FS if you want it to work
Reply
#3

Quote:

The problem is if I do a command from a different filterscript it will give me this message and it won't do the command. So if anyone has any ideas on how to fix this, that would be great.

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success) SendClientMessage(playerid, COLOR_RED, "No such command! Type /cmds for a list of player commands.");
    return 1;
}
Place it into this filterscript, that you're using?

Quote:

Try CTRL+F search for SERVER: Unknown command

Replace with what you want.

Works for me. also, you've to put that into every FS if you want it to work

Oh, really? Very smart :P
Reply
#4

Quote:
Originally Posted by uprp
Посмотреть сообщение
Try CTRL+F search for SERVER: Unknown command

Replace with what you want.

Works for me. also, you've to put that into every FS if you want it to work
lol ? There is no SERVER: Unknown command in any gamemode, by default this is what samp-server returns if their is no custom message returned of from a faulty custom made command.

And if you want ALL messages to say your custom message, you'll have to add it to each filterscript ONLY if they are ZCMD (since you said you use it) OR merge each filterscript into your gamemode and convert it to ZCMD.
Reply
#5

Quote:
Originally Posted by uprp
Посмотреть сообщение
Try CTRL+F search for SERVER: Unknown command

Replace with what you want.

Works for me. also, you've to put that into every FS if you want it to work
are you kidding or what?
thre no server uknown command in pawno it setted automatically from SAMP if samp cannot find command that you type
Reply
#6

Note that you need to define FILTERSCRIPT before including ZCMD if using it inside a filterscript.

Quote:
Originally Posted by Horrible
are you kidding or what?
thre no server uknown command in pawno it setted automatically from SAMP if samp cannot find command that you type
Interesting, I had no idea a text editor had so much power. And technically SA:MP doesn't automatically send the message when you type an incorrect command, only when you return 0 in the callback, hence why you can send custom messages.
Reply
#7

I use this methode already for about 1-2 years, never had any kind of problems with this.
Perhaps this is what you are searching for, I also added your desired message.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
}
    return SendClientMessage(playerid, COLOR_RED, "No such command! Type /cmds for a list of player commands.");
}
Reply
#8

Thanks for trying to help, but I figured it out on my own. I just had to put it only in the last filterscript that loads.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)