public void Use(Player p, string[] args)
 {
     if (ZombiePlugin.ZombiePlugin.ZombieRoundEnabled)
     {
         p.SendMessage("You cannot use this right now!");
         return;
     }
     p.SendMessage("[Zombie Survival]: " + Colors.red + "Starting the round!");
     WOM.GlobalSendAlert(p.Username + " started the round");
     ZombiePlugin.ZombiePlugin.AmountOfMinutesElapsed = 1;
     ZombiePlugin.ZombiePlugin.AmountOfSecondsElapsed = 59;
 }
Example #2
0
 public void Use(Player p, string[] args)
 {
     if (!ZombiePlugin.ZombiePlugin.ZombieRoundEnabled || ZombiePlugin.ZombiePlugin.AmountInfected() <= 1 || ZombiePlugin.ZombiePlugin.AmountOfMinutesElapsed - 1 > 8)
     {
         p.SendMessage("You cannot use this right now!");
         return;
     }
     if (args.Length == 0 && ZombiePlugin.ZombiePlugin.AmountInfected() > 1)
     {
         ZombieHelper.DisinfectPlayer(ZombiePlugin.ZombiePlugin.FindPlayer(p));
         WOM.GlobalSendAlert(p.Username + " force disinfected themselves");
         return;
     }
     else if (args.Length == 1 && ZombiePlugin.ZombiePlugin.AmountInfected() > 1)
     {
         if (args[0] == "random")
         {
             ZombieHelper.DisinfectRandomPlayer(ZombiePlugin.ZombiePlugin.ExtraPlayerData);
             WOM.GlobalSendAlert(p.Username + " force disinfected a random player");
             return;
         }
         else
         {
             ExtraPlayerData z = ZombiePlugin.ZombiePlugin.FindPlayer(args[0]);
             if (z != null && z.Infected)
             {
                 ZombieHelper.DisinfectPlayer(z);
                 ZombieHelper.DisplayDisinfectMessage(z.Player, null);
                 WOM.GlobalSendAlert(p.Username + " force disinfected " + args[0]);
             }
             else if (!z.Infected)
             {
                 p.SendMessage("You cannot use this right now!");
             }
             else
             {
                 p.SendMessage("Player is not online!");
             }
             return;
         }
     }
     p.SendMessage("You need to specify a player, random or no player!");
 }
 public void Use(Player p, string[] args)
 {
     if (!ZombiePlugin.ZombiePlugin.Voting)
     {
         if (!ZombiePlugin.ZombiePlugin.ZombieRoundEnabled)
         {
             p.SendMessage("You cannot use this right now!");
             return;
         }
     }
     p.SendMessage("[Zombie Survival]: " + Colors.red + "Ending the round!");
     WOM.GlobalSendAlert(p.Username + " ended the round");
     if (!ZombiePlugin.ZombiePlugin.Voting)
     {
         ZombiePlugin.ZombiePlugin.AmountOfMinutesElapsed = 10;
     }
     if (ZombiePlugin.ZombiePlugin.Voting)
     {
         ZombiePlugin.ZombiePlugin.AmountOfMinutesElapsed = 2;
     }
 }
Example #4
0
 public void Use(Player p, string[] args)
 {
     if (args.Length < 2 || args.Length > 2)
     {
         p.SendMessage("You need to specify an option and a choice!");
         return;
     }
     if (args[0] == "level")
     {
         ArrayList     al = new ArrayList();
         DirectoryInfo di = new DirectoryInfo("levels/");
         FileInfo[]    fi = di.GetFiles("*.cw");
         foreach (FileInfo fil in fi)
         {
             al.Add(fil.Name.Split('.')[0]);
         }
         if (al.Contains(args[1]))
         {
             ZombiePlugin.ZombiePlugin.LevelNameQueued = args[1];
             ZombiePlugin.ZombiePlugin.LevelQueued     = true;
             p.SendMessage(args[1] + " was queued (it will silently be chosen next round!)");
             WOM.GlobalSendAlert(p.Username + " queued the level " + args[1]);
         }
         else
         {
             p.SendMessage("You need to specify a proper level name!");
             return;
         }
     }
     else if (args[0] == "zombie")
     {
         if (args[0] == null)
         {
             p.SendMessage("You need to specify a player!");
             return;
         }
         ExtraPlayerData s = ZombiePlugin.ZombiePlugin.FindPlayer(args[1]);
         if (s == null)
         {
             p.SendMessage("Could not find player :(");
             return;
         }
         ZombiePlugin.ZombiePlugin.ZombieNameQueued = args[1];
         ZombiePlugin.ZombiePlugin.ZombieQueued     = true;
         p.SendMessage(s.Player.Username + " was queued!");
         WOM.GlobalSendAlert(p.Username + " queued the zombie " + args[1]);
     }
     else if (args[0] == "gamemode")
     {
         int i = int.Parse(args[1]);
         if (i < 0 || i > 3)
         {
             p.SendMessage("You need to specify a gamemode!");
             return;
         }
         ZombiePlugin.ZombiePlugin.GameModeIntQueued = i;
         ZombiePlugin.ZombiePlugin.GameModeQueued    = true;
         p.SendMessage(ZombiePlugin.ZombieHelper.GetGamemode(i) + " was queued!");
         WOM.GlobalSendAlert(p.Username + " queued the gamemode " + args[1]);
     }
     else
     {
         p.SendMessage("You must select a valid option!");
     }
 }