public void Use(Player p, string[] args) { if (!ZombiePlugin.ZombiePlugin.ZombieRoundEnabled) { p.SendMessage("You cannot use this right now!"); return; } if (ZombiePlugin.ZombiePlugin.ZombieRoundEnabled) { p.SendMessage("[Zombie Survival]: " + Colors.red + "You cannot toggle survivor while a round is in progress!"); return; } ExtraPlayerData z = ZombiePlugin.ZombiePlugin.FindPlayer(p); z.Survivor = !z.Survivor; p.SendMessage("Survivor mode is now " + z.Survivor.ToString().Replace("True", "on!").Replace("False", "off!")); }
public void Use(Player p, string[] args) { ExtraPlayerData z = ZombiePlugin.ZombiePlugin.FindPlayer(p); z.Aka = !z.Aka; foreach (Player e in Server.Players.ToArray()) { Packet pa = new Packet(new byte[2] { (byte)Packet.Types.SendDie, e.ID }); if (p != e) { p.SendPacket(pa); } } p.SpawnOtherPlayersForThisPlayer(); p.SendMessage("Aka mode is now " + z.Aka.ToString().Replace("True", "on!").Replace("False", "off!")); }
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) { ExtraPlayerData temp = ZombiePlugin.ZombiePlugin.FindPlayer(p); temp.Referee = !temp.Referee; if (temp.Referee) { temp.DateTimeAtStartOfRef = DateTime.Now.Ticks; } p.SendMessage("Referee mode is now " + temp.Referee.ToString().Replace("True", "on!").Replace("False", "off!")); if (!p.IsHidden) { p.GlobalDie(); } p.IsHidden = !p.IsHidden; if (!p.IsHidden) { p.SpawnThisPlayerToOtherPlayers(); } ZombieHelper.SendUserType(temp); }
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!"); } }
public void Use(Player p, string[] args) { if (!ZombiePlugin.ZombiePlugin.ZombieRoundEnabled) { p.SendMessage("You cannot use this right now!"); return; } ExtraPlayerData P = ZombiePlugin.ZombiePlugin.FindPlayer(p); p.SendMessage(Colors.red + "-----------------" + Server.DefaultColor + "Zombie Store" + Colors.red + "---------------"); if (args.Length < 1) { Help(p); p.SendMessage(Colors.red + "-----------------" + Server.DefaultColor + "Zombie Store" + Colors.red + "---------------"); return; } if (args[0] == "1") { if ((ZombiePlugin.ZombiePlugin.ZombieRoundEnabled || ZombiePlugin.ZombiePlugin.AmountInfected() > 1 || ZombiePlugin.ZombiePlugin.AmountOfMinutesElapsed - 1 > 8) && P.Infected) { if (p.Money >= 25) { ZombieHelper.TakeMoney(p, 25); ZombieHelper.DisinfectPlayer(P); } else { p.SendMessage("You do not have enough money for this!"); } } else { p.SendMessage("You can not use this right now!"); } } else if (args[0] == "2") { int message12 = 5; try { message12 = int.Parse(args[1]); } catch {} if (p.Money >= (Math.Round(0.2 * message12))) { if (message12 < 5) { message12 = 5; } P.AmountOfBlocksLeft += message12; p.Money = p.Money - (Convert.ToInt32(Math.Round(0.2 * message12))); p.SendMessage("You now have " + Colors.maroon + P.AmountOfBlocksLeft + Server.DefaultColor + " blocks!"); } else { p.SendMessage("You do not have enough " + Server.Moneys); } } else if (args[0] == "3") { if (P.Infected) { p.SendMessage("&9Zombies may not use this item.."); return; } p.IsHidden = true; p.GlobalDie(); Player.UniversalChat(p.Color + p.Username + "&ahas &0vanished!"); Thread.Sleep(10000); Player.UniversalChat(p.Color + p.Username + "&ahas &0appeared"); p.IsHidden = false; p.SpawnThisPlayerToOtherPlayers(); } else if (args[0] == "4") { if (args.Length >= 2) { if (args[1] == "del") { p.ExtraData.ChangeOrCreate("InfectMessage", ""); p.ExtraData.Save(p, "InfectMessage"); p.SendMessage("Cleared infect message!"); } else if (p.Money >= 400) { var strs = new List <string>(args); strs.RemoveAt(0); ZombieHelper.TakeMoney(p, 400); p.ExtraData.ChangeOrCreate("InfectMessage", String.Join(" ", strs.ToArray())); p.ExtraData.Save(p, "InfectMessage"); p.SendMessage("Changed infect message to " + String.Join(" ", strs.ToArray()) + "!"); } else { p.SendMessage("You do not have enough money for this!"); } } else { Help(p); } } else if (args[0] == "5") { if (args.Length >= 2) { if (args[1] == "del") { p.ExtraData.ChangeOrCreate("DisinfectMessage", ""); p.ExtraData.Save(p, "DisinfectMessage"); p.SendMessage("Cleared disinfect message!"); } else if (p.Money >= 400) { var strs = new List <string>(args); strs.RemoveAt(0); ZombieHelper.TakeMoney(p, 400); p.ExtraData.ChangeOrCreate("DisinfectMessage", String.Join(" ", strs.ToArray())); p.ExtraData.Save(p, "DisinfectMessage"); p.SendMessage("Changed disinfect message to " + String.Join(" ", strs.ToArray()) + "!"); } else { p.SendMessage("You do not have enough money for this!"); } } else { Help(p); } } p.SendMessage(Colors.red + "-----------------" + Server.DefaultColor + "Zombie Store" + Colors.red + "---------------"); }