Rust-Kits

Moved

Total Downloads: 70,199 - First Release: Oct 21, 2014 - Last Update: Jun 7, 2018

4.96216/5, 185 likes
  1. If you want to change the cooldown display from seconds to the total hours, minutes, seconds left change the line

    Code:
    reason += $"- {Math.Abs(Math.Ceiling(cd - ct))} seconds";
    To
    Code:
    TimeSpan time = TimeSpan.FromSeconds(Math.Abs(Math.Ceiling(cd - ct)));
    string full_time = string.Format ("{0:00}h,{1:00}m,{2:00}s", (int)time.TotalHours, time.Minutes, time.Seconds);
    reason += $"- {full_time} cooldown";
    
    Output is now something like
    Code:
    mykit - awesome kit description - 5h,21m,30s cooldown
    
    Also change
    Code:
    if (kitData.cooldown > ct && kitData.cooldown != 0.0)
    return $"You need to wait {Math.Abs(Math.Ceiling(kitData.cooldown - ct))} seconds to use this kit";
    
    to
    Code:
    if (kitData.cooldown > ct && kitData.cooldown != 0.0)
    {   
         TimeSpan time = TimeSpan.FromSeconds(Math.Abs(Math.Ceiling(kitData.cooldown - ct)));
          string full_time = string.Format ("{0:00}h,{1:00}m,{2:00}s", (int)time.TotalHours,     time.Minutes, time.Seconds);
           return $"You need to wait {full_time} to use this kit";
    }
     
    Last edited by a moderator: Aug 3, 2016
  2. That will cause an error something along the lines of
    An embedded statement may not be a declaration or labeled statement
    on the 2nd part of your code
     
  3. Fixed it :)
     
    Last edited by a moderator: Aug 3, 2016
  4. I tested your code
    Error while compiling Kits.cs(434,33): error CS1525: Unexpected symbol `('
     
  5. weird sounds like a typo somewhere, but I checked that line and don't see it, here's a tested copy of the file
     

    Attached Files:

    • Kits.cs
      File size:
      46.5 KB
      Views:
      31
  6. What you have there is not the same as what you posted before
     
  7. Thats what I mean, I put the kitname and it simply says that the item doen't exist.
     
  8. How so?

    Just searched the lines/changes I posted and they look the same to me friend :)
    [DOUBLEPOST=1470270245][/DOUBLEPOST]
    My config looks something like this

    Code:
    {
      "Kits": {
        "starterhouse": {
          "name": "starterhouse",
          "description": "Resources to build a new house",
          "max": 0,
          "cooldown": 43200.0,
          "authlevel": 0,
          "xpamount": 0,
          "hide": false,
          "npconly": false,
          "permission": null,
          "image": null,
          "building": null,
          "items": [
            {
               etc...
    
    with starterhouse being the kit name. I generated this by following the plugins description page. Also remember to

    Code:
    3) /kit items => this will copy the items in your inventory to set it as the new kit. you don't need to do it seperatly you can do it in the previous line: /kit authlevel 2 items hide true
    
     
  9. Your post on the other page the code is like this
    Code:
    if (kitData.cooldown > ct && kitData.cooldown != 0.0)
    {
         TimeSpan time = TimeSpan.FromSeconds(Math.Abs(Math.Ceiling(kitData.cooldown - ct)));
          string full_time = string.Format ("{0:00}h,{1:00}m,{2:00}s", (int)time.TotalHours,     time.Minutes, time.Seconds);
           return $"You need to wait {full_time} to use this kit";
    }
    in the script its like this
    Code:
    if (kitData.cooldown > ct && kitData.cooldown != 0.0)
             {   
               TimeSpan time = TimeSpan.FromSeconds(Math.Abs(Math.Ceiling(kitData.cooldown - ct)));
               string full_time = string.Format ("{0:00}h,{1:00}m,{2:00}s", (int)time.TotalHours, time.Minutes, time.Seconds);
               return $"You need to wait {full_time} to use this kit";
               //return $"You need to wait {Math.Abs(Math.Ceiling(kitData.cooldown - ct))} seconds to use this kit";
             }
      }
    
    I am sure you see the diff
     
  10. I don't other than the spaces, is that all? which I can't imagine would make a difference given their locations, the code formatter for the forum is rough, in any case you have the file, so others can just use that if they want :) Hopefully the plugin author will include this formatting option officially
     
  11. the extra } at the end helps as well dont you think

    Well here is the file with the extra spaces removed
     

    Attached Files:

    • Kits.cs
      File size:
      46.5 KB
      Views:
      26
  12. I'm not really sure why you felt the need to drag this out, neither the code I posted on here nor the code in the file I uploaded had that extra } from what I can tell, and the extra space wasn't present in the code file, it only existed on code I posted here from the bad formatting for a new line.
     
  13. Attached Files:

    • Kits.cs
      File size:
      46.9 KB
      Views:
      32
  14. Someone could explain how to create a VIP kit?
     
  15. My post on page 107 please next time look at past posts first
     
  16. [Oxide] 13:45 [Info] HumanNPC and PathFinding were compiled successfully in 1916ms
    [Oxide] 13:45 [Info] Unloaded plugin PathFinding v1.0.1 by Reneb / Nogrod
    [Oxide] 13:45 [Error] Error while compiling HumanNPC.cs(670,70): error CS1503: Argument `#2' cannot convert `Rust.DamageType' expression to type `BaseEntity'
    [Oxide] 13:45 [Info] Loaded plugin PathFinding v1.0.1 by Reneb / Nogrod
     
  17. T
    Thank you
     
  18. Wrong plugin
     
  19. I created VIP Kit with permission kits.vip and authlevel 0 but everyone can still see it. How to fix this issue? I even used the command:
    oxide.revoke group default kits.vip but everyone is still able to see it..
     
  20. See my post on page 107 and upload the kits.json file from your data folder
    Do you have a vip group if not make one and grant that group Kits.vip permission