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
-
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 -
I tested your code
Error while compiling Kits.cs(434,33): error CS1525: Unexpected symbol `(' -
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:
-
-
What you have there is not the same as what you posted before
-
Thats what I mean, I put the kitname and it simply says that the item doen't exist.
-
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
with starterhouse being the kit name. I generated this by following the plugins description page. Also remember toCode:{ "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
-
Your post on the other page the code is like this
in the script its like thisCode: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"; }
I am sure you see the diffCode: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 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 -
the extra } at the end helps as well dont you think
Well here is the file with the extra spaces removedAttached Files:
-
-
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.
-
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?
-
My post on page 107 please next time look at past posts first
-
[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
Thank you -
Wrong plugin
-
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.. -
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