Rust Economics leaderboard

Discussion in 'Plugin Requests' started by tomhud, May 6, 2018.

  1. Can anyone knock me up a quick plugin that will show me the top 20/30 players Money
    It doesnt need to be anything fancy as this is for me to test something and is not for players to see (admin only)
    Appreciate any help at all.
     
  2. Hello,

    A quick edit of economics plugin can do the tricks
    Open and edit the plugin as following:

    In LoadDefaultMessages() function add ["CommandTop"] = "top",
    http://astucesa2balles.com/upload/download.php?file=1525601964.png

    In Init() function add AddLocalizedCommand("CommandTop", "TopCommand");
    http://astucesa2balles.com/upload/download.php?file=1525602102.png

    Then add anywhere that
    Code:
            #region Top Command        private void TopCommand(IPlayer player, string command, string[] args)
            {
                if (!player.HasPermission(permAdmin) || !player.HasPermission(permBalance))
                {
                    Message(player, "NotAllowed", command);
                    return;
                }
                var amount = from pair in storedData.Balances
                    orderby pair.Value descending
                    select pair;            if (args != null && args.Length > 0)
                {                for (int i = 0; i < Convert.ToInt32(args[0]); i++)
                    {
                        IPlayer target = FindPlayer(amount.ElementAt(i).Key, player);
                        if (target == null)
                        {
                            continue;
                        }
                        Message(player, "PlayerBalance", target.Name, Balance(target.Id));
                    }            }
                else
                {
                    for (int i = 0; i < 5; i++)
                    {
                        IPlayer target = FindPlayer(amount.ElementAt(i).Key, player);
                        if (target == null)
                        {
                            continue;
                        }
                        Message(player, "PlayerBalance", target.Name, Balance(target.Id));
                    }
                }
            }        #endregion Top Command
    
    This code work on the plugin Economics from Wulf/lukespragg v3.4.0
     
  3. thanks will test this
    Appreciated
     
  4. PlayerRanks stores economics in SQL table if that's any use.
     
  5. it would be if i knew how to get the info out :)
     
  6. If you don't have/use SQL server it's not worth the bother, but would have been handy if you did. ;)