How to add msg when wrong command
#1

How do i make it so when someone types a command that is not available it automatically says something like


"Command does not exist, read /commands for available commands"



Without me putting it into each command.
Reply
#2

At the bottom of OnPlayerCommandText replace the line "return 0;" by:
pawn Код:
return SendClientMessage(playerid, color, "Command does not exist, read /commands for available commands"); // replace color with your color name;
}
Reply
#3

i was about to suggest this one:
below all other commands in
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
// all commands
// ...
	SendClientMessageToAll(0xff0000ff,"no command found matching your requested one");
	return 0;
}
and i now know i was wrong
thx, Coicatak! you fixed one bug in my script
Reply
#4

Quote:
Originally Posted by Babul
i was about to suggest this one:
below all other commands in
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
// all commands
// ...
	SendClientMessageToAll(0xff0000ff,"no command found matching your requested one");
	return 0;
}
and i now know i was wrong
thx, Coicatak! you fixed one bug in my script
Actually this should also work.
And you're welcome
Reply
#5

It would work but then it would show

"no command found matching your requested one"
"SERVER: Unknown Command."
Reply
#6

Oups, you're right.
Reply
#7

smart aleck. i wrote "i was wrong", and i accepted the other solution too - further i typed it in approx 40 seconds, please forgive me my bad scripting. and maybe you can read the text around the code section too - then you wouldnt need to push your posts up?
btw: its not that hard to figure out the return 0; will print the unknown-shit, then to remove it, aint it? its 1 line below my (wrong) suggestion...
i wont answer to that topic anymore. i see it as solved now. so flame me, insult me. i wont respond here
Reply
#8

I lol'ed. We never insulted or flamed you, and you freak out, this is lol worthy.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)