I don't have "Unknow 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I don't have "Unknow command" (
/showthread.php?tid=264198)
I don't have "Unknow command" -
ludesert - 25.06.2011
Hello, all is in the title. When I type a command (for example, /erphigeih), I don't have any error message.
How can I make a error message, for example : "Unknow command, type /cmds to have a list of the commands" ?
Thanks =)
Re: I don't have "Unknow command" -
xRyder - 25.06.2011
Like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return SendClientMessage(playerid, color, "Unknow command, type /cmds to have a list of the commands");
}
Re : I don't have "Unknow command" -
ludesert - 25.06.2011
I use DCMD commands. Will it work ?
Re: I don't have "Unknow command" -
[HiC]TheKiller - 25.06.2011
Just change the return 0; near the end of OnPlayerCommandText to
pawn Код:
return SendClientMessage(playerid, color, "Unknow command, type /cmds to have a list of the commands");
Like xRyder said and it will work.
Re: I don't have "Unknow command" -
Lorenc_ - 25.06.2011
ZCMD:
pawn Код:
public OnCommandPerformed(playerid, cmdtext, success)
{
if(!success) return SendClientMessage(playerid, -1, "Not a command, /help");
return 1;
}
Forgot the parameters but shouldd work..
Re : I don't have "Unknow command" -
ludesert - 25.06.2011
Thanks to all, I will try this
Re : I don't have "Unknow command" -
ludesert - 25.06.2011
Thx, it work