1. can you share?
     
  2. Posted in between your old post and his new post.
     
  3. ??? did you get this to work in info panel to show RP?
     
  4. Look at the older posts, it still works.
     
  5. ok so im guessing that this section of code needs to be changed to work with Server rewards callhooks??????

    Code:
            #region Balance        private Balance Bala;
            private Timer BalanceUpdater;
            public class Balance
            {
                public int RefreshRate = 3;            public Balance(int RefreshRate)
                {
                    this.RefreshRate = RefreshRate;
                }            public double GetBalance(string PlayerID)
                {
                    var player = RustCore.FindPlayerByIdString(PlayerID);
                    if (player == null) return 0;
                    return (double)(Interface.Oxide.CallHook("GetPlayerMoney", player.userID) ?? 0.0);
                }            public void Refresh(StoredData storedData, Dictionary<string, Dictionary<string, IPanel>> panels)
                {
                    if (!Settings.CheckPanelAvailability("Balance"))
                        return;                foreach (var panel in panels)
                    {
                        IPanel iPanel;
                        if (!panel.Value.TryGetValue("BalanceText", out iPanel)) continue;
                        var balance = $"{GetBalance(panel.Key):N}";
                        var panelText = (IPanelText)iPanel;
                        if (!balance.Equals(panelText.Content))
                        {
                            panelText.Content = balance;
                            panelText.Refresh();
                        }
                    }
                }
            }
            #endregion
    [DOUBLEPOST=1488258759][/DOUBLEPOST]
    what older posts im confused????
     
  6. Code:
    [PluginReference] Plugin ServerRewards
    static InfoPanel instance;
    void OnServerInitialized()
    {
       instance =this;
    }
    Code:
    public int GetBalance(string id)
                {
                    var player = RustCore.FindPlayerByIdString(id);
                    if (player == null) return 0;
                    return (int)instance.ServerRewards?.Call("CheckPoints", Convert.ToUInt64(id));
                }
    [DOUBLEPOST=1488258917][/DOUBLEPOST]I believe that's all, if I'm missing something it's on page one in this post.
     

  7. im sorry dont mean to sound dumb but where do each of those codes go at???
     
  8. I dont mean to bring up an old thread but I have the same question as Brohawk. Where do i put these codes? Im guessing they go in InfoPanel.cs , but where? Maybe which line #?
     
    Last edited by a moderator: Jul 9, 2017
  9. For the latest version (0.9.5), see below:

    Line 633 is the OnServerInitialized hook, vanilla should look like this:
    Code:
           void Init()
            {
                LoadConfigValues();
                LoadData();
            }        void OnServerInitialized()
            {
                Clock = new Watch
    You can add these values above OnServerInitialized (make sure your indentation is correct):
    Code:
            void Init()
            {
                LoadConfigValues();
                LoadData();
            }
            //Add these two
            [PluginReference] Plugin ServerRewards;
            static InfoPanel instance;        void OnServerInitialized()
            {
                Clock = new Watch
    
    INSIDE OnServerInitialized, add this:
    Code:
            void OnServerInitialized()
            {
                //Add this
                instance = this;
                Clock = new Watch
    Then replace lines 1316-1321 with this:
    Code:
    public int GetBalance(string id)
               {
                   var player = RustCore.FindPlayerByIdString(id);
                   if (player == null) return 0;
                   return (int)instance.ServerRewards?.Call("CheckPoints",  Convert.ToUInt64(id));
               }
    Edit: Fixed typo
     
    Last edited by a moderator: Jul 9, 2017
  10. Damn! This is the error I'm getting now.
    Error while compiling: InfoPanel.cs(635,8): error CS1519: Unexpected symbol `static' in class, struct, or interface member declaration

    I feel that I should mention this. I re-installed ServerRewards and got this in the RCON console:

    [ServerRewards] All UI elements have been successfully generated!
    Calling 'OnServerInitialized' on 'ServerRewards v0.4.55' took 486ms

    I have attached the .CS file.
     
  11. Typo, my bad. Add a semi-colon after [PluginReference] Plugin ServerRewards

    From this:
    Code:
    [PluginReference] Plugin ServerRewards
    To this:
    Code:
    [PluginReference] Plugin ServerRewards;
     
  12. thanks Canopy Sheep that work
     
  13. where do i input this ?
    [DOUBLEPOST=1501461320][/DOUBLEPOST]
    could you please help as i'm trying to convert to rp , thank you
     
  14. See my post above (#29)
     
  15. sorry but i have a file for info panel in config and data , don't see what your talking about . sorry for my stupidity on this , but the plugin it self could have updated to accommodate a function like this.
     
  16. where do you locate this ??? Line 633 is the OnServerInitialized hook, vanilla should look like this:. is it hard to just put it in laymans terms...?
     
  17. i can't seem to find this info ??? could you help please
    [DOUBLEPOST=1501603041][/DOUBLEPOST]
    never mind found it .lol
    [DOUBLEPOST=1501604556][/DOUBLEPOST]
    thank thank thank !!! got it working , however i have both coins and rp collecting , how do i stop economics from collecting or do i just remove it now .
     
  18. Open the GatherRewards.json file and turn it to this:

    Code:
        "UseEconomics": false,
        "UseServerRewards": true