Having trouble giving a kitSolved

So im trying to give kit with Give plugins method or whatever you call it but it just doesnt seem to work like i want it to.

        void OnEnterZone(string ItemCollectingZone, BasePlayer player)
        {
            Timer t = null;
            t = timer.Repeat(1f, repeatamount, () =>
            {

                covalence.Server.Command("givekit item" + " " + player.UserIDString);

                if (player.inventory.GetAmount(-542577259) == maxamount)
                {
                    t.Destroy();
                    player.ChatMessage("You Have Maxium Amount Of This Item");
                }             
            });
        }

I keep getting this in my console

76561198806642765 is not a valid kit
So im having little problem with hooks. I just can't figure out how to place these hooks correctly.

    {
        [PluginReference]
        Plugin Kits, Economics, ZoneManager, HumanNPC, ImageLibrary, Give;

        int ItemCollectingZone = 14062081;
        int maxamount = 120;
        int repeatamount = 120;
        int giveamount = 1;


        void OnEnterZone(string ItemCollectingZone, BasePlayer player)
        {
            Timer t = null;
            t = timer.Repeat(1f, repeatamount, () =>
            {

                covalence.Server.Command("givekit item" + " " + player.UserIDString);

                if (player.inventory.GetAmount(-542577259) == maxamount)
                {
                    t.Destroy();
                    player.ChatMessage("You Have Maxium Amount Of This Item");
                }             
            });
        }
    }​

Right now when you enter the zone it starts the timer and keeps giving you kit until it have reached certain amount and it will destroy the timer but i also want to add OnExitZone hook so when you exit the zone it will also destroy the timer. Right now it just keeps going till it have reached maxamount even when you leave the zone.

//Example
void OnExitZone(string ZoneID, BasePlayer player)
               {
                    t.Destroy();
                    player.ChatMessage("You Have Left The Zone");
               }

Thanks for helping me out :)

You should be using the Kits plugin directly.

Also, you aren't using the args right for that givekit command.

5e13a8d5b2bc5.jpg Wulf
You should be using the Kits plugin directly.

I tried to do that but i didn't find correct things in there.

What was the usage you had with Kits directly?
5e13a8d5b2bc5.jpg Wulf
What was the usage you had with Kits directly?

Something like this

GiveKit(player, kitname);

Also tried to check some code like 

        private object GiveKit(BasePlayer player, string kitname)
        {
            if (string.IsNullOrEmpty(kitname)) return GetMsg("Emptykitname", player.userID);
            kitname = kitname.ToLower();
            Kit kit;
            if (!storedData.Kits.TryGetValue(kitname, out kit)) return GetMsg("NoKitFound",player.userID);

            foreach (var kitem in kit.items)
            {
                GiveItem(player.inventory,
                    kitem.weapon
                        ? BuildWeapon(kitem.itemid, kitem.skinid, kitem.mods)
                        : BuildItem(kitem.itemid, kitem.amount, kitem.skinid, kitem.blueprintTarget),
                    kitem.container == "belt"
                        ? player.inventory.containerBelt
                        : kitem.container == "wear"
                            ? player.inventory.containerWear
                            : player.inventory.containerMain);
            }

But didnt really find something that i could use.
There must be more to that, like getting data or something i have no idea right now.

That isn't how you'd use or call another plugin. Did you check the plugin page for Kits for examples?
5e13a8d5b2bc5.jpg Wulf
That isn't how you'd use or call another plugin. Did you check the plugin page for Kits for examples?

I did. I want it to give kit automaticly to player that enters the zone. i maybe could do that with 

covalence.Server.Command("Command");
Just can't figure out args order for that. Actually i tested it. I think theres no way to give kit like that.

Merged post

Actually i found this kits.consolegive gonna test this out.
5e13a8d5b2bc5.jpg Wulf
That isn't how you'd use or call another plugin. Did you check the plugin page for Kits for examples?

kit give player/steamid kitname seems to be usage but i have no idea how i can add that into

covalence.Server.Command("Command");


Merged post

Found this
covalence.Server.Command("addgroup ", player.Name, FirstJoinGroup, " 2d");​

but it doesn't seem to work.

You seem to have switched gears with what you are wanting to do... Are you trying to give a kit or add a player to a group? The group command you are using is not native to Oxide, it from a plugin.

For giving a kit, you should be using the plugin methods directly, not commands.
5e13a8d5b2bc5.jpg Wulf
You seem to have switched gears with what you are wanting to do... Are you trying to give a kit or add a player to a group? The group command you are using is not native to Oxide, it from a plugin.

For giving a kit, you should be using the plugin methods directly, not commands.
well seems like my C# and oxide knowledge aint that good yet :) also that was just an example i found from another post.
Locked automatically