If you want to change the cooldown display from seconds to the total hours, minutes, seconds left change the line
ToCode:reason += $"- {Math.Abs(Math.Ceiling(cd - ct))} seconds";
Output is now something likeCode: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";
Also changeCode:mykit - awesome kit description - 5h,21m,30s cooldown
toCode: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";
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"; }
Rust-Kits
Moved
Total Downloads: 70,199 - First Release: Oct 21, 2014 - Last Update: Jun 7, 2018
- 4.96216/5, 185 likes
-
An embedded statement may not be a declaration or labeled statement
on the 2nd part of your code -
Error while compiling Kits.cs(434,33): error CS1525: Unexpected symbol `(' -
Attached Files:
-
-
-
-
Just searched the lines/changes I posted and they look the same to me friend
[DOUBLEPOST=1470270245][/DOUBLEPOST]
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...
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
-
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"; }
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"; } }
-
Hopefully the plugin author will include this formatting option officially
-
Well here is the file with the extra spaces removedAttached Files:
-
-
-
Here's a new version that displays days as well if they exist
Example
https://dl.dropboxusercontent.com/u/50354233/kits.pngAttached Files:
-
-
Someone could explain how to create a VIP kit?
-
-
[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 -
T
-
-
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.. -
Do you have a vip group if not make one and grant that group Kits.vip permission