Rust-Kits

Moved

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

4.96216/5, 185 likes
  1. Yes I have seen the video and have been using kits for a long time now. I used to use just the default autokit but have tried setting up custom autokits and now it doesn't seem to work properly.

    Interestingly enough, after trying to do some troubleshooting myself I've figured something out regarding this.

    I've added some Puts commands into the code of Kits.cs to verify that custom autokits are properly being read as well as to see why I am defaulting to the last kit in the list even though I have proper permissions.

    Upon trying to give me the VIPKit, it fails and the variable 'success' as a string outputs: You do not have enough inventory space for this Kit! Here are the Puts I have used.

    Code:
    if (storedData.Kits.ContainsKey("autokit"))
                    {
                        player.inventory.Strip();
                        GiveKit(player, "autokit");
                        Puts("gave regular autokit");
                        return;
                    }
                    foreach (var entry in AutoKits.OrderBy(k=>k.Key))
                        {
                            Puts(entry.Value);
                            var success = CanRedeemKit(player, entry.Value, true) as string;
                            Puts(success);
                            if (success != null) continue;
                            player.inventory.Strip();
                            success = GiveKit(player, entry.Value) as string;
                            Puts("gave player " + entry.Value);
                            if (success != null) continue;
                            proccessKitGiven(player, entry.Value);
                            return;
                        }
    This is the console output corresponding with my Puts: Gyazo - 7bfc1e01876ac09a051e4997778260d5.png
     
    Last edited by a moderator: Apr 5, 2017
  2. upload your config and kits.json from data folder will have a look
     
  3. I just edited my last post with new information. Any ideas?
     
  4. Have you been editing the cs file?
     
  5. Only to add these Puts commands. I've written and published a plugin myself on here so I know I haven't altered anything that would break the code.
     
  6. As you have changed the code there is no way to know if your code is causing your problems so you need to test with the default plugin and if no problems there then you will know its your changes there is no way I can help as you need to do the testing
     
  7. It seems as though the issue occurs any time I set up a kit with more than 12 items in the Main container. Even with a fresh install of Kits on a separate locally hosted server, any time I try to put more than 12 items in the Main container Kits thinks there isn't enough space in the players inventory and doesn't grant that kit.

    You can see the math below and the output of my testing here: Gyazo - fa67477382d3309fd18d9798b9fe7e1d.png

    Code:
    int beltcount = kit.items.Where(k => k.container == "belt").Count();
                int wearcount = kit.items.Where(k => k.container == "wear").Count();
                int maincount = kit.items.Where(k => k.container == "main").Count();
                Puts("main capacity: " + player.inventory.containerMain.capacity);
                Puts("itemlist count: " + player.inventory.containerMain.itemList.Count);
                Puts("maincount: " + maincount);
                int totalcount = beltcount + wearcount + maincount;
                if ((player.inventory.containerBelt.capacity - player.inventory.containerBelt.itemList.Count) < beltcount || (player.inventory.containerWear.capacity - player.inventory.containerWear.itemList.Count) < wearcount || (player.inventory.containerMain.capacity - player.inventory.containerMain.itemList.Count) < maincount)
                    if(totalcount > (player.inventory.containerMain.capacity - player.inventory.containerMain.itemList.Count))
                        return GetMsg("NoInventorySpace", player.userID);
    Even though it shows that the Main container has a capacity of 24 (because I was dead and had nothing in my inventory upon spawn) and the VIPKit only had 18 items stored in the Main container, it still acted as if it was over capacity and denied granting the user the kit.

    I had a suspicion that the plugin StackSizeController could be an issue, but I've just confirmed that it isn't. I thought that Kits would see a stack of over 128 bullets and split them into multiple 128 sets and this could be triggering the NoInventorySpace message, but after some testing this isn't the issue.
     
    Last edited by a moderator: Apr 5, 2017
  8. Did you test this with the default plugin?
     
  9. Yes, I did. The same issue still occurs.
     
  10. Have problem with Custom Autokits:
    in config
    "Custom AutoKits": {
    "0": "elitespawn",
    "1": "startspawn"
    },
    and kits with permissions, permission kits.elitespawn to group elite and kits.spawn for group default, but i not elite and no privs elitespawn respawn with elitespawn kit.
    sorry my bad english
     
  11. if i understand you need grant user a group to spawn kit on him (with priv.)

    grant group <groupname> <permission>
    usergroup add <username> <groupname>

    Command to add the autokit is:

    /kit add "autokit" "blabla bla bla" -admin => dont forgot to add the -admin to prevent players from requesting it manually
     
    Last edited by a moderator: Apr 5, 2017
  12. No, not default autokit.
    Custom autokits for spawn with different kits on elite accounts and default accounts .

    already set and dont work:
     
  13. dunno what u set than but it works :)
     
  14. sNT

    sNT

    Hey is there anyway that you can make it so u can have a certain kit only for the steam members?
     
  15. Then you need to upload your files
     
  16. I've been using kits for a few months now. First off, amazing plugin, very useful! If I had one idea (or question), it would be: How do I make it so kits have a delay before being able to be redeemed after a wipe? For instance, I have VIP kits setup. I don't want the VIPs to instantly have access to the kits on wipeday. Is there any way that you guys can think of that I can delay a certain kit from being redeemed immediately on wipe day? I'd like for people to have to wait 24 hours or so. I don't mind doing it manually or something, just need to know if there's a way to do this at all right now. Thank you and keep up the wonderful work!
     
  17. No one has any ideas? Why are two of the custom autokits with different permissions for other groups always given to everyone first on the list cistom autokits.
     
  18. Tiger i bit dont understand u need explain it bit more ;)
    [DOUBLEPOST=1491487180][/DOUBLEPOST]
    tryied this ? /kit items max xx cooldown 3600 description "Every hour kit, max usage: xx"
     
  19. Okey.

    I'm install plugin.
    Create group elite in oxide and have default group.
    Remove autokit for work custom autokits.
    Create 2 custom autokits
    elitespawn with perms kits.elitespawn
    startspawn with perms kits.spawn

    grant perm kits.elitespawn to group elite
    grant perm kits.spawn to group default

    in kits config write:

    "Custom AutoKits": {
    "0": "elitespawn",
    "1": "startspawn"
    },

    Problem, players with group default spawns with kit elitespawn and group elite spawn with elitespawn.
    If i change the order to:
    "Custom AutoKits": {
    "0": "startspawn",
    "1": "elitespawn"
    },
    then elite and default group spawn with startspawn


    No, this cooldown between usages, he want cooldown before first usage
     
  20. Universal, do you know how I can start a chat line break within a kits name or something similar.
     
    Last edited by a moderator: Apr 6, 2017