Command Suggestion - /RoundInfo

Conor

Member
Joined
Dec 12, 2012
Messages
34
Reaction score
103
Points
18
Website
cipbot.webs.com
Wassup. So I thought I'd suggest a command here. I'm not sure what variables you guys use and/or what lists you may add zombies/humans to when distinguishing between players; so I'll use Player.infected, Player.human and Player.referee here. I'm also assuming you change the server's main level to the current map being played.

Code:
using System;
 
namespace MCZombie
{
    public class CmdRoundInfo : Command
    {
        public override string name { get { return "roundinfo"; } }
        public override string[] aliases { get { return new string[] { "rni" }; } }
        public override string type { get { return "information"; } }
        public override bool museumUsable { get { return true; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
        public CmdRoundInfo();
 
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/roundinfo - displays some key information about the current round.");
        }
 
        public override void Use(Player p, string message)
        {
            string zombies = "Nobody", humans = "Nobody", referees = "Nobody";
 
            Player.players.ForEach(delegate(Player who)
            {
                if (!who.hidden)
                { 
                    if (who.infected)
                    {
                        zombies += who.name + ", ";
                    }
                    else if (who.human)
                    {
                        humans += who.name + ", ";
                    }
                    else if (who.referee)
                    {
                        referees += who.name + ", ";
                    }
                } 
            });
 
            if (zombies != "Nobody")
            {
                zombies = zombies.Remove(zombies.LastIndexOf(','));
            }
            if (humans != "Nobody")
            {
                humans = humans.Remove(humans.LastIndexOf(','));
            }
            if (referees != "Nobody")
            {
                referees = referees.Remove(referees.LastIndexOf(','));
            }
 
            Player.SendMessage(p, c.red + "Map: " + c.white + Server.mainLevel);
            Player.SendMessage(p, c.red + "Zombies: " + c.white + zombies);
            Player.SendMessage(p, c.red + "Humans: " + c.white + humans);
            Player.SendMessage(p, c.red + "Referees: " + c.white + referees);
            Command.all.Find("time").Use(p, "");
        }
    }
}
 

Conor

Member
Joined
Dec 12, 2012
Messages
34
Reaction score
103
Points
18
Website
cipbot.webs.com
No, it is a command to show the player some key information about the round and its current state.

If you look near the bottom of the code, you see the information that is presented to the player.

- Current map
- Current zombies
- Current humans
- Current referees
- Round time remaining
 

Conor

Member
Joined
Dec 12, 2012
Messages
34
Reaction score
103
Points
18
Website
cipbot.webs.com
Just out of curiosity, do you guys have an /alive or /infected command of some sort? Or is the /players command the only current way to acknowledge which players are alive/infected?

If the latter is the case, I would recommend making the really simple commands, they are well known globally across the zombie survival network, your server would be a little more noob-friendly :D
 

Hockeyfan1852

Member
Joined
Feb 29, 2012
Messages
1,146
Reaction score
1,400
Points
113
Just out of curiosity, do you guys have an /alive or /infected command of some sort? Or is the /players command the only current way to acknowledge which players are alive/infected?

If the latter is the case, I would recommend making the really simple commands, they are well known globally across the zombie survival network, your server would be a little more noob-friendly :D
We have a /left command that lists all the humans left.