using System;
using System.Threading;
using System.Collections.Generic;
namespace MCDzienny
{
public class CmdAutorank : Command
{
public string firstRank=null;//change this, null, to your first rank and so on.
public string secondRank=null;
public string thirdRank=null;
public string fourthRank=null;
public string fithRank=null;
public string sixthRank = null;
public string seventhRank = null;
public string eighthRank = null; //to right here ^change those ranks to your ranks, add or remove as suits you.
public long change;
private static List<Player> tracking = new List<Player>();
public override string name { get { return "autorank"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return "mod"; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public CmdAutorank() { }
public override void Use(Player p, string message)
{
if (!tracking.Contains(p))
{
change = p.overallBlocks;
tracking.Add(p);
Thread buildThread = new Thread(new ThreadStart(delegate
{
while (p.disconnected != true)
{
try
{
if (p.overallBlocks == 500 && p.group == Group.Find(firstRank)) //<--- You can replace the numbers to how many blocks placed you want for a levelup
{
//firstrank
Command.all.Find("promote").Use(null, p.name); //dont replace null here.
}
if (p.overallBlocks == 1000 && p.group == Group.Find(secondRank))
{
//secondrank
Command.all.Find("promote").Use(null, p.name);
}
if (p.overallBlocks == 3000 && p.group == Group.Find(thirdRank))
{
//thirdrank
Command.all.Find("promote").Use(null, p.name);
}
if (p.overallBlocks == 5000 && p.group == Group.Find(fourthRank))
{
//fourthrank
Command.all.Find("promote").Use(null, p.name);
}
if (p.overallBlocks == 7000 && p.group == Group.Find(fithRank))
{
//fithrank
Command.all.Find("promote").Use(null, p.name);
}
if (p.overallBlocks == 10000 && p.group == Group.Find(sixthRank))
{
//sixthrank
Command.all.Find("promote").Use(null, p.name);
}
if (p.overallBlocks == 15000 && p.group == Group.Find(seventhRank))
{
//seventhrank
Command.all.Find("promote").Use(null, p.name);
}
if (p.overallBlocks == 18000 && p.group == Group.Find(eighthRank))
{
//eightrank
Command.all.Find("promote").Use(null, p.name); //again add or remove the if(~~~~){ } to how many ranks you have.
}
if (p.group.Permission >= LevelPermission.Operator)
{ //what this says is that nothing will happen with ops, you can change it if you want to, to follow^^
return;
}
}
catch
{
Player.GlobalMessage("There is an error in autorank"); //this will only pop up if you did not put all of your ranks under op.
return;
}
}
}));
buildThread.Start();
}
else
{
return;
}
}
public override void Help(Player p)
{
}
}
}
using System;
using System.Threading;
using System.Collections.Generic;
namespace MCDzienny
{
public class CmdAutorank : Command
{
public string firstRank="ember";//change this, null, to your first rank and so on.
public string secondRank="shocker";
public string thirdRank="fire";
public string fourthRank="advfire";
public string fithRank="ultrafire";
public string sixthRank = "megafire";
public string seventhRank = "uberfire";
public string eighthRank = "gigafire";//to right here ^change those ranks to your ranks, add or remove as suits you.
private static List<Player> tracking = new List<Player>();
public override string name { get { return "autorank"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return "mod"; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public CmdAutorank() { }
public override void Use(Player p, string message)
{
if (!tracking.Contains(p) && p.level.name.ToLower() == "guest_fb2") //replace guest_fb2 with the name of your freebuild map, or if you want global rank just remove all of guest_fb2 part.
{
long change = p.overallBlocks;
Player.SendMessage(p, "Build for autorank!");
tracking.Add(p);
Thread buildThread = new Thread(new ThreadStart(delegate
{
while (p.disconnected != true)
{
if (p.level.name.ToLower() != "guest_fb2" || p.group.Permission>=Group.Find(eighthRank).Permission)
{
change = p.overallBlocks-change;
Player.SendMessage(p, "Building ended, you made a block difference of " + change.ToString());
tracking.Remove(p);
return;
}
try
{
change = p.overallBlocks - change;
if (change == 100 && p.group == Group.Find(firstRank)) //<--- You can replace the numbers to how many blocks placed you want for a levelup
{
//firstrank
Command.all.Find("promote").Use(null, p.name); change = p.overallBlocks;
Command.all.Find("review").Use(p, "ask");
//dont replace null here.
}
if (change == 250 && p.group == Group.Find(secondRank))
{
//secondrank
Command.all.Find("review").Use(p, "ask");
Command.all.Find("promote").Use(null, p.name); change = p.overallBlocks;
}
if (change == 500 && p.group == Group.Find(thirdRank))
{
//thirdrank
Command.all.Find("review").Use(p, "ask");
Command.all.Find("promote").Use(null, p.name); change = p.overallBlocks;
}
if (change == 1000 && p.group == Group.Find(fourthRank))
{
//fourthrank
Command.all.Find("review").Use(p, "ask");
Command.all.Find("promote").Use(null, p.name); change = p.overallBlocks;
}
if (change == 1250 && p.group == Group.Find(fithRank))
{
//fithrank
Command.all.Find("review").Use(p, "ask");
Command.all.Find("promote").Use(null, p.name); change = p.overallBlocks;
}
if (change == 1500 && p.group == Group.Find(sixthRank))
{
//sixthrank
Command.all.Find("review").Use(p, "ask");
Command.all.Find("promote").Use(null, p.name); change = p.overallBlocks;
}
if (change == 1750 && p.group == Group.Find(seventhRank))
{
//seventhrank
Command.all.Find("review").Use(p, "ask");
Command.all.Find("promote").Use(null, p.name); change = p.overallBlocks;
}
if (change == 2000 && p.group == Group.Find(eighthRank))
{
//eightrank
Command.all.Find("review").Use(p, "ask");
Command.all.Find("promote").Use(null, p.name); change = p.overallBlocks; //again add or remove the if(~~~~){ } to how many ranks you have.
}
}
catch
{
Player.GlobalMessage("There is an error in autorank"); //this will only pop up if you did not put all of your ranks under op.
return;
}
}
}));
buildThread.Start();
}
else
{
return;
}
}
public override void Help(Player p)
{
}
}
}
Users browsing this forum: No registered users and 8 guests