lucasds12 wrote:It would be recognized like this, correct if I get this code wrong, I am a #C beginner.
- Code: Select all
if (message == "unknowncommand")
{
Help(p);
Player.SendMessage("Invalid command");
return;
-Lucas
This wont work. you are missing a } and the help message will only appear if you type in unknowncommand.
if you want everythinging one if block 94ge7j998, you can also do this:
- Code: Select all
if (message != "command1" && message != "command2")
{
//help / error message here
}
the != sign will return true if it isn't true.
the && sign will say the computer only executes the if block if multiple things are true.
If you want more commands after it, do this:
- Code: Select all
&& message != "command3"