Give weapon error

Discussion in 'Rust Development' started by eed, Jun 11, 2017.

  1. eed

    eed

    Code
    Code:
            [ChatCommand("givebow")]
            void givebow(BasePlayer player)
            {
                if (!player.IsAdmin) return;
                Item weapon = ItemManager.CreateByName("bow.hunting", 1, 0);
                weapon.info.name = "123";
                //weapon.info.itemid = -3028;
                player.inventory.GiveItem(weapon);
            }
    Error
    Code:
    at Oxide.Plugins.TeleportArrow.givebow (.BasePlayer player) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.TeleportArrow.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0 
     
  2. I tested your function, worked for me, hmmm
     
  3. eed

    eed

    you used command /givebow in game?
     
    Last edited by a moderator: Jun 11, 2017
  4. eed

    eed

    weapon bow is bug on my server.
    Dont craft/get in admin panel.
    Craft error
    upload_2017-6-11_13-8-43.png
     
  5. I added this as plugin to my server, ran chat command /givebow in game, and it worked, hmmm

    What version of Oxide are you using?
    Do you have other plugins installed?
     
    Last edited by a moderator: Jun 11, 2017