Hello, I am willing to take requests for people who want an Auto Ranking system command. I just need some information first and also to point out some notes.
Example: survivor : 10 ^ That means that when the player reaches level 10, he/she will be ranked to "survivor".
Notes: # If you have experience in coding, you can use the code I have at the end of the topic. # If you change the ranks in your server while having Auto Rank, it will not function properly, you must remove it then request another. # The command will have to be activated after every start up, so if you restart, you must use /autosystem enable again.
...while (active) { Thread.Sleep(10000); foreach (Player pl in Player.players) ... Player.SendMessage(p, "/autorank - Checks player stats every 10 secs to see if the can rankup."); } } }
Sidenote: In my opinion, the stats check should be much longer than 10 seconds(no offense to you Leeizazombie). To give an approximation, the time should be between 4 and 12 minutes. If you have a small server(10-15 players), your number should be closer to 4 minutes, and if your server is large(45-50 players), your number should be closer to 12 minutes.
Here are my recommendations on a chart to help people out:
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.
But players will be disappointed to wait for their ranked, as I've already notice with 10 seconds I shall create a timer instead of using Thread.Sleep, those ms's will be handy to me, thanks. Maybe I can make it an optional setting to alter the refresh rate hmm?
Owner of: LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated) LeeIzaZombie Survival (Comming back soon)
Leeizazombie wrote:I've added the Timer, it's now much reliable while refreshing every 5 seconds, this will guarantee no extreme usage of CPU.
Hmm...possibly better, because not many other commands use the timer feature yet. But still I don't recommend 5 seconds...make it 20 seconds least(4x per min = a lot of work ).
The timer's ms compared to the round's ms cannot exceed 25%...or bad things can happen!
Ex: Timer: 5000 ms - (5 sec) Round time: 20,000 ms - (20 sec)
Anyway, we'll need some people to test out your command.
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.
Lee, you should really make it read from a config file. It would be so much easier than having people request the new command each time. I know how to do this, but there's no fun in it if I just tell you how to do it. Hint: string.Split();
asdfmovie2121 wrote:Lee can you make me a auto-rank system?? Heres my ranks and the levels I want them to be Potential:3 Aware:15 Survivor:30 ExpertedHuman:50 Leader:70
using System; using System.IO; using System.Threading; using System.Timers;
namespace MCDzienny { public class Auto_System : Command { public override string name { get { return "autosystem"; } } public override string shortcut { get { return ""; } } public override string type { get { return "information"; } } public override bool museumUsable { get { return true; } } public override LevelPermission defaultRank { get { return LevelPermission.Admin; } } bool active = false; public override void Use(Player p, string message) { if (message == "enable") { if (active) { Player.SendMessage(p, "The system is already active!"); return; } Player.SendMessage(p, "Activated!"); active = true; var myTimer = new System.Timers.Timer(); myTimer.Elapsed += new ElapsedEventHandler(checkStats); myTimer.Interval = 5000; myTimer.Enabled = true; } } private void checkStats(object source, ElapsedEventArgs e) { Player.players.ForEachSync(pl => { if (pl.group.name == "guest") // Upgrading by Level 3 { if (pl.ZombieTier >= 3) { Command.all.Find("setrank").Use(null, pl.name + " potential Auto: You got to level 5!"); } } else if (pl.group.name == "potential") // Upgrading by Level 15 { if (pl.ZombieTier >= 15) { Command.all.Find("setrank").Use(null, pl.name + " aware Auto: You got to level 10!"); } } else if (pl.group.name == "aware") // Upgrading by Level 30 { if (pl.ZombieTier >= 30) { Command.all.Find("setrank").Use(null, pl.name + " survivor Auto: You got to level 20!"); } } else if (pl.group.name == "survivor") // Upgrading by Level 50 { if (pl.ZombieTier >= 50) { Command.all.Find("setrank").Use(null, pl.name + " expertedHuman Auto: You got to level 30!"); } } else if (pl.group.name == "expertedHuman") // Upgrading by Level 70 { if (pl.ZombieTier >= 70) { Command.all.Find("setrank").Use(null, pl.name + " leader Auto: You got to level 40!"); } }
}); } public override void Help(Player p) { Player.SendMessage(p, "/autosystem enable - Checks player stats every 5 seconds."); } } }
One problem, I can't tell what the players start level is on your server, you never mentioned. Like what rank they are as level 1. I assumed it was "guest", if it isn't please let me know or look in the code and change it!
Enjoy!
Owner of: LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated) LeeIzaZombie Survival (Comming back soon)