[RotMG] How to edit rank tags and how to add ranks

Results 1 to 1 of 1
  1. #1
    Member Glorious is offline
    MemberRank
    Jan 2016 Join Date
    50Posts

    [RotMG] How to edit rank tags and how to add ranks

    You navigate to player.cs which is located in wServer>Realm>Entities>Player>Player.cs
    Search for this
    Code:
                 this.psr = psr;
                statsMgr = new StatsManager(this);
                switch(psr.Account.Rank) {
    Under this will be
    Code:
                     case 0:
                        Name = psr.Account.Name; break;
                    case 1:
                        Name = "[Helper] " + psr.Account.Name; break;
                    case 2:
                        Name = "[Donator] " + psr.Account.Name; break;
                    case 3:
                        Name = "[Moderator] " + psr.Account.Name; break;
                    case 4:
                        Name = "[Developer] " + psr.Account.Name; break;
                    case 5:
                        Name = "[HDeveloper] " + psr.Account.Name; break;
                    case 6:
                        Name = "[Co-Owner] " + psr.Account.Name; break;
                    case 7:
                        Name = "[Owner] " + psr.Account.Name; break;
                        
                }
    To change the title of a rank you just rename what is inside the "[]" So you could change "[Owner] " to, "[Founder] "

    I will now show you an example of how to add a rank
    Code:
                        Name = "[Developer] " + psr.Account.Name; break;
                    case 5:
    Copy and pasting this and then change the rank name
    Code:
                        Name = "[Ragezone] " + psr.Account.Name; break;
                    case 5:
    I will then place this in the list wherever i want it to be in the ladder of authority
    Code:
                     case 0:
                        Name = psr.Account.Name; break;
                    case 1:
                        Name = "[Helper] " + psr.Account.Name; break;
                    case 2:
                        Name = "[Donator] " + psr.Account.Name; break;
                    case 3:
                        Name = "[Moderator] " + psr.Account.Name; break;
                    case 4:
                        Name = "[Ragezone] " + psr.Account.Name; break;
                    case 5:
                        Name = "[Developer] " + psr.Account.Name; break;
                    case 5:
                        Name = "[HDeveloper] " + psr.Account.Name; break;
                    case 6:
                        Name = "[Co-Owner] " + psr.Account.Name; break;
                    case 7:
                        Name = "[Owner] " + psr.Account.Name; break;
                        
                }
    I now have two rank 5's ("case 5:" is rank 5) so i increase the value of all of them going up by one so that it is continuously increasing in value such as 1, 2, 3, 4...
    it should now look like this
    Code:
                     case 0:
                        Name = psr.Account.Name; break;
                    case 1:
                        Name = "[Helper] " + psr.Account.Name; break;
                    case 2:
                        Name = "[Donator] " + psr.Account.Name; break;
                    case 3:
                        Name = "[Moderator] " + psr.Account.Name; break;
                    case 4:
                        Name = "[Ragezone] " + psr.Account.Name; break;
                    case 5:
                        Name = "[Developer] " + psr.Account.Name; break;
                    case 6:
                        Name = "[HDeveloper] " + psr.Account.Name; break;
                    case 7:
                        Name = "[Co-Owner] " + psr.Account.Name; break;
                    case 8:
                        Name = "[Owner] " + psr.Account.Name; break;
                        
                }
    This means that the "Ragezone" rank is a rank under developer and a rank over Moderator. To add this to the /rank command list you navigate to admincommands.cs which is located at wServer>Realm>Entities>Commands>admincommands.cs
    You then navigate to
    Code:
         class Rank : ICommand
        {
            public string Command { get { return "rank"; } }
            public int RequiredRank { get { return 4; } }
    
            public void Execute(Player player, string[] args)
            {
                if (args.Length < 2)
                {
                    player.SendHelp("Usage: /rank <username> <number>\n0: Player\n1: Donator\n2: Game Master\n3: Developer\n4: Head Developer\n5: Admin");
                }
                else
                {
                    try
                    {
                        using (Database dbx = new Database())
                        {
                            var cmd = dbx.CreateQuery();
                            cmd.CommandText = "UPDATE accounts SET rank=@rank WHERE name=@name";
                            cmd.Parameters.AddWithValue("@rank", args[1]);
                            cmd.Parameters.AddWithValue("@name", args[0]);
                            if (cmd.ExecuteNonQuery() == 0)
                            {
                                player.SendInfo("Could not change rank");
                            }
                            else
                                player.SendInfo("Account rank successfully changed");
                        }
                    }
                    catch
                    {
                        player.SendInfo("Could not change rank, please change rank in database");
                    }
                }
            }
        }
    or alternatively ctrl+f "/rank"

    You then edit this "Usage: /rank <username> <number>\n0: Player\n1: Donator\n2: Game Master\n3: Developer\n4: Head Developer\n5: Admin"

    "n3: Developer" means that /rank (players name) 3 makes them a developer so we re organise this as in this it says that case 3 is developer (This is a unorganized command which i will do now i do apologise for not adding the other commands prior to this)

    You should replace the text inside usage if you replaced the rank part of player.cs with mine
    Code:
    ("Usage: /rank <username> <number>\n0: Player\n1: Helper\n2: Donator\n3: Moderator\n4: Ragezone\n5: Developer\n6: Head Developer\n7: Co-Owner\n8: Owner");
    Thank you for reading this and hope you put this to use to manage your servers ;)

    Please support us by helping us make a section by speaking your mind at this link
    http://forum.ragezone.com/f600/secti...99/index2.html




Advertisement