that would be nice to have, check if there is a plugin that copies note texts already, maybe Replenish for Rust | Oxide
if there is none, a new little task for plugin devs is born![]()
Rust-Kits
Moved
Total Downloads: 70,199 - First Release: Oct 21, 2014 - Last Update: Jun 7, 2018
- 4.96216/5, 185 likes
-
@Reneb Why is it still not implemented that kits won't be redeemed if inventory is full or doesn't have enough space? This should be an important feature.
If anyone is interested, I added it by myself months ago and have to readd it on every update. Feel free to copy it to your Kits.cs
Open Kits.cs and find:
Code:object GiveKit(BasePlayer player, string kitname) { if (string.IsNullOrEmpty(kitname)) return "Empty kit name"; kitname = kitname.ToLower(); Kit kit; if (!storedData.Kits.TryGetValue(kitname, out kit)) return "This kit doesn't exist";
Then just insert the following code after it:
Code:if (player.inventory.containerMain.IsFull()) { return "Your inventory seems to be full. Can't redeem kit."; } int belt = 0; int wear = 0; int main = 0; foreach (KitItem kitem in kit.items) { if (kitem.container == "belt") { belt++; } else if (kitem.container == "wear") { wear++; } else { main++; } } if (main + player.inventory.containerMain.itemList.Count > player.inventory.containerMain.capacity) { return "You don't have enough space in your MAIN inventory."; } if (belt + player.inventory.containerBelt.itemList.Count > player.inventory.containerBelt.capacity) { return "You don't have enough space in your BELT."; } if (wear + player.inventory.containerWear.itemList.Count > player.inventory.containerWear.capacity) { return "You don't have enough space in your CLOTHING inventory."; }
-
Who should I contact, out of the devs, that would be good to do this?Last edited by a moderator: Nov 7, 2016 -
we know the solution is already built in Replenish.cs and you want that in Kits.cs:
1. look for the codelines in Replenish.cs or ask Skrallex how he did it.
2. when you got the code together try to make your own version of Kits.cs
3. send your Version to Renab and ask him to make it right and update his plugin
4. say thank you to Skrallex and Renab, no matter if it works out or not
most people would probably:
1. ask Renab to do everything
2. jerk off
-
What are the permissions for this plugin cant find them or am i blind -_- ?
-
-
i am authlvl 2 but it still say's no perm -
Custom Permissions:
when you created a kit or edited a kit do:
/kit permission PERMISSIONNAME
the permissionname can be a new permission or an existing permission.
but thats how you set permissions for kits,
there is nothing else needed but authlvl 1 or 2 to use admin commands, so if you are auth 2 and the plugin is the right one, there should be no problem. -
Its weird that i get that i dont have any perm's then because other plugins work
-
if you delete the autokit can you remake another one or not? doesnt seem like i can
-
{
if (!storedData.Kits.ContainsKey("autokit")) return;
var thereturn = Interface.Oxide.CallHook("canRedeemKit", player);
if (thereturn == null)
{
player.inventory.Strip();
GiveKit(player, "autokit");
}
}
If you actually deleted it, you should be able to make a new one called 'autokit', if not, its still there and you can edit it -
-
-
Attached Files:
-
-
sorry, i cant find any mistake, for what i know it should work.
-
-
Hello guys could you someone of you make me an kit starter simple one pls im new
-
cant be explaned better than that i think, probably theres a youtube video somewhere too ^^ -
the one from Factions.cs works -
See my post on page 202 on making kits
[DOUBLEPOST=1478577784][/DOUBLEPOST]