/visits <topten/all> -Top ten players who visited the server

/visits <topten/all> -Top ten players who visited the server

Postby HelloWorldCool » 31 Oct 2011, 21:47

/visits <topten/all> -Top ten players who visited the server/total number of visits.

This would be nice to find out who visited the most and also how many people visited your server!
(although you could probably just go online and look at the unique visits count).
Download fCraft maps! - viewtopic.php?f=25&t=3012!



Note: The Developer(s) of MCDzienny have resigned and the software is no longer supported.
Errors are bound to occur and Mojang has not attempted to resolve them.
User avatar
HelloWorldCool
 
Posts: 867
Joined: 18 Oct 2011, 00:19
Location: MCDzienny Forums, HelloWorldCool Forums

Re: /visits <topten/all> -Top ten players who visited the se

Postby Ultima » 07 Dec 2011, 12:21

I will look into it if i dont forget it. 8-)
User avatar
Ultima
 
Posts: 953
Joined: 19 Aug 2011, 23:45

Re: /visits <topten/all> -Top ten players who visited the se

Postby Ultima » 08 Dec 2011, 11:23

Code: Select all
namespace MCDzienny
{
    using System;
    using System.Data;

    public class CmdBestScores : Command
    {
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/topten - Displays names of ten best players.");
        }

        public override void Use(Player p, string message)
        {
            Player.SendMessage(p, "Top ten round scores:");
            DataTable table = DBInterface.fillData("SELECT * FROM `Players` ORDER BY bestScore DESC LIMIT 10", false);
            for (int i = 0; i < table.Rows.Count; i++)
            {
                Player.SendMessage(p, string.Concat(new object[] { "%c", i + 1, ". ", table.Rows[i]["Name"].ToString(), " - best score: ", table.Rows[i]["bestScore"].ToString() }));
            }
        }

        public override LevelPermission defaultRank
        {
            get
            {
                return LevelPermission.Banned;
            }
        }

        public override bool museumUsable
        {
            get
            {
                return true;
            }
        }

        public override string name
        {
            get
            {
                return "bestscores";
            }
        }

        public override string shortcut
        {
            get
            {
                return "bs";
            }
        }

        public override string type
        {
            get
            {
                return "other";
            }
        }
    }
}


This is the actual code for /topten, just replace the bestscore with the row name of visits. (If u wait when i get home, i will change it.)
User avatar
Ultima
 
Posts: 953
Joined: 19 Aug 2011, 23:45


Return to Requests for Addon

Who is online

Users browsing this forum: No registered users and 3 guests

cron