Sending certain messages:
You can send Global messages and messages that only the player can see.
For a Global message, which is a message shown to all players online, you use:
- Code: Select all
Player.GlobalMessage("Hello world!");
To send a message to the player you can use:
- Code: Select all
Player.SendMessage(p, "Hey me!");
Always remember the "p," part as that will tell the server that the message goes to you, you can also use it to send message to other players.
Finding a player and then executing a code:
- Code: Select all
if (message == "")
{
Help(p);
return;
}
string playerName = message.Split(' ')[0];
Player who = Player.Find(playerName);
if (who == null)
{
Player.SendMessage(p, "Player is not online.");
return;
}
else
{
// Code goes here when player is found.
Player.SendMessage(p, "You found " + who.color + who.PublicName);
}
Using an in-game command:
- Code: Select all
Command.all.Find("CommandNameHere").Use(p, "Command Arguments");
For example I will give a player a title:
- Code: Select all
Command.all.Find("settitle").Use(p, "LeeIzaZombie IrishLad");
Where "LeeIzaZombie IrishLad" is the argument for "settitle", as if I used /settitle LeeIzaZombie IrishLad
You can leave the argument blank for commands like /shutdown
I hope I helped, please request any help that you need!