Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace MCGalaxy
- {
- public class CmdIntro : Command
- {
- public override string name { get { return "Intro"; } }
- public override string shortcut { get { return ""; } }
- public override string type { get { return "other"; } }
- public override bool museumUsable { get { return false; } }
- public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
- public override void Use(Player p, string message)
- {
- if (LevelInfo.MapExists(p.name)) {
- if (MapCountAfterFirst(p) > 0) {
- Player.SendMessage(p, "&7You have more than one map!");
- Player.SendMessage(p, "&7Use %f/os go [number] %7to choose which to go to.");
- Player.SendMessage(p, "&7Not sure which maps you have?");
- Player.SendMessage(p, "&7Use %f/search levels " + p.name);
- return;
- }
- Player.SendMessage(p, "&7Taking you to your map with %f/os go&7...");
- Thread.Sleep(500);
- Command.all.Find("os").Use(p, "go");
- Thread.Sleep(1000);
- Player.SendMessage(p, "&7Return to the hub world with %f/main%7.");
- }
- else {
- if (MapCountAfterFirst(p) == 1) {
- Player.SendMessage(p, "&7You have a map, but it's not your first map.");
- Player.SendMessage(p, "&7Use %f/os go [number] %7to get to the map you have.");
- Player.SendMessage(p, "&7Not sure which number it is?");
- Player.SendMessage(p, "&7Use %f/search levels " + p.name);
- return;
- }
- if (MapCountAfterFirst(p) > 1) {
- Player.SendMessage(p, "&7You have more than one map!");
- Player.SendMessage(p, "&7Use %f/os go [number] %7to choose which to go to.");
- Player.SendMessage(p, "&7Not sure which maps you have?");
- Player.SendMessage(p, "&7Use %f/search levels " + p.name);
- return;
- }
- Player.SendMessage(p, "%cYou don't have any maps yet!");
- Player.SendMessage(p, "%7To create a basic flat map, use %f/os map add%7.");
- Player.SendMessage(p, "%7You can also make a map with custom size and theme.");
- Player.SendMessage(p, "%7Go to the info portal (or %f/goto info%7) to learn how.");
- Player.SendMessage(p, "%7Once you've made a map, use %f/os go %7or this portal to get to it");
- }
- }
- public int MapCountAfterFirst(Player p)
- {
- //Thanks UnknownShadow200
- int amount = 0;
- string level = p.name.ToLower();
- // subtract 1, because we accounted for it in above if statement
- for (int i = 2; i < (p.group.OverseerMaps - 1) + 2; i++) {
- if (LevelInfo.MapExists(level + i)) amount++;
- }
- return amount;
- }
- public override void Help(Player p)
- {
- Player.Message(p, "%T/intro");
- Player.Message(p, "%HCommand used in the REALM portal.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement