daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Aug 12th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Threading;
  3.  
  4. namespace MCGalaxy
  5. {
  6.     public class CmdIntro : Command
  7.     {
  8.         public override string name { get { return "Intro"; } }
  9.         public override string shortcut { get { return ""; } }
  10.         public override string type { get { return "other"; } }
  11.         public override bool museumUsable { get { return false; } }
  12.         public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
  13.         public override void Use(Player p, string message)
  14.         {
  15.             if (LevelInfo.MapExists(p.name)) {
  16.                 if (MapCountAfterFirst(p) > 0) {
  17.                     Player.SendMessage(p, "&7You have more than one map!");
  18.                     Player.SendMessage(p, "&7Use %f/os go [number] %7to choose which to go to.");
  19.                     Player.SendMessage(p, "&7Not sure which maps you have?");
  20.                     Player.SendMessage(p, "&7Use %f/search levels " + p.name);
  21.                     return;
  22.                 }
  23.                 Player.SendMessage(p, "&7Taking you to your map with %f/os go&7...");
  24.                 Thread.Sleep(500);
  25.                 Command.all.Find("os").Use(p, "go");
  26.                 Thread.Sleep(1000);
  27.                 Player.SendMessage(p, "&7Return to the hub world with %f/main%7.");
  28.             }
  29.             else {
  30.                 if (MapCountAfterFirst(p) == 1) {
  31.                     Player.SendMessage(p, "&7You have a map, but it's not your first map.");
  32.                     Player.SendMessage(p, "&7Use %f/os go [number] %7to get to the map you have.");
  33.                     Player.SendMessage(p, "&7Not sure which number it is?");
  34.                     Player.SendMessage(p, "&7Use %f/search levels " + p.name);
  35.                     return;
  36.                 }
  37.                 if (MapCountAfterFirst(p) > 1) {
  38.                     Player.SendMessage(p, "&7You have more than one map!");
  39.                     Player.SendMessage(p, "&7Use %f/os go [number] %7to choose which to go to.");
  40.                     Player.SendMessage(p, "&7Not sure which maps you have?");
  41.                     Player.SendMessage(p, "&7Use %f/search levels " + p.name);
  42.                     return;
  43.                 }
  44.                 Player.SendMessage(p, "%cYou don't have any maps yet!");
  45.                 Player.SendMessage(p, "%7To create a basic flat map, use %f/os map add%7.");
  46.                 Player.SendMessage(p, "%7You can also make a map with custom size and theme.");
  47.                 Player.SendMessage(p, "%7Go to the info portal (or %f/goto info%7) to learn how.");
  48.                 Player.SendMessage(p, "%7Once you've made a map, use %f/os go %7or this portal to get to it");
  49.             }
  50.            
  51.         }
  52.        
  53.         public int MapCountAfterFirst(Player p)
  54.         {
  55.             //Thanks UnknownShadow200
  56.             int amount = 0;
  57.             string level = p.name.ToLower();
  58.             // subtract 1, because we accounted for it in above if statement
  59.             for (int i = 2; i < (p.group.OverseerMaps - 1) + 2; i++) {
  60.                 if (LevelInfo.MapExists(level + i)) amount++;
  61.             }
  62.             return amount;
  63.         }
  64.        
  65.         public override void Help(Player p)
  66.         {
  67.             Player.Message(p, "%T/intro");
  68.             Player.Message(p, "%HCommand used in the REALM portal.");
  69.         }
  70.     }
  71. }
RAW Paste Data
Top