/client [player]

/client [player]

Postby Leeizazombie » 15 Mar 2014, 17:18

Hey guys I'm back, you may of noticed on my servers I can check if your client is xWom / CPE, well here's the command, pretty simple! :)

Note: Your server will NOT recognise xWom users if you do not have a config file set in your motd! if you don't understand this you could just use the example one, set your motd to: &0cfg=mcdzienny.cba.pl/cfg (and if you need -hax tag)

Code:
Code: Select all
using System;
using System.Threading;

namespace MCDzienny
{
    public class CmdClient : Command
    {
        public override string name { get { return "client"; } }
        public override string shortcut { get { return ""; } }
        public override string type { get { return "information"; } }
        public override bool museumUsable { get { return false; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
        public override void Use(Player p, string message)
        {
            Player who = Player.Find(message.Split(' ')[0]);
            if (who != null)
            {
                string CPE = "Unknown";
                string wom = "Unknown";
                string xWoM = "Unknown";

                if (who.IsCpeSupported)
                {
                    CPE = "%aTrue";
                }
                else if (!who.IsCpeSupported)
                {
                    CPE = "%cFalse";
                }
                if (who.IsUsingWom)
                {
                    wom = "%aTrue";
                }
                else if (!who.IsUsingWom)
                {
                    wom = "%cFalse";
                }
                if (who.IsUsingXWom)
                {
                    xWoM = "%aTrue";
                }
                else if (!who.IsUsingXWom)
                {
                    xWoM = "%cFalse";
                }

                Thread.Sleep(100);
                int hours = p.TotalMinutesPlayed / 60;
                int remainingmins = p.TotalMinutesPlayed % 60;
                Player.SendMessage(p, "%0----------[" + who.color + who.PublicName + "%0]----------");
                Player.SendMessage(p, Server.DefaultColor + "CPE supported = " + CPE);
                Player.SendMessage(p, Server.DefaultColor + "Using WoM  = " + wom);
                Player.SendMessage(p, Server.DefaultColor + "Using xWoM = " + xWoM);
                Player.SendMessage(p, Server.DefaultColor + "Time Played = %7" + hours + " %eHours and%7 " + remainingmins + "%e Minutes");
            }
            else
            {
                Player.SendMessage(p, "Player not found.");
            }

        }
       
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/client [player] - Checks players client info.");
        }
    }
}
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: /client [player]

Postby HETAL » 15 Mar 2014, 17:37

Some clients (Not all) send a Client Name when they connect, last time I checked the ClassiCube client did, maybe if there was a way to retrieve the client name, you could make this even better :) .
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: /client [player]

Postby dzienny » 15 Mar 2014, 18:01

Nice command :idea: You could also make a version that would check CPE support (and annonced it?) on login. In the upcoming release I added an extension for /players command that will list players that support CPE, and those that don't.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: /client [player]

Postby Leeizazombie » 16 Mar 2014, 10:04

dzienny wrote: You could also make a version that would check CPE support (and annonced it?) on login.

I actually put that part in my Zombie Server bot :lol:
Code: Select all
else
                {
                    Thread.Sleep(3000);
                    Player.GlobalMessage(botname + "Welcome to %aLee%fIza%6Zombie%f's Zombie Server,  %e" + e.Player.PublicName + "! :D");
                    if (e.Player.IsCpeSupported)
                    {
                        Player.GlobalMessageOps("%0:-------------%8[%cOperator Message%8]%0-------------");
                        Player.GlobalMessageOps(botname + e.Player.color + e.Player.PublicName + "%f uses ClassiCube.");
                        Player.GlobalMessageOps("%0:------------------------------------------------");
                    }
                }
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 6 guests

cron