1. Hello,
    I try to write a plugin base on Human NPC but i have an error during compilation.

    "1:38 PM [Error] Error while compiling armurier.cs(46,17): error CS0127: `Oxide.Plugins.Armurier.OnUseNPC(BasePlayer, BasePlayer)': A return keyword must not be followed by any expression when method returns void"
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Oxide.Core;
    using UnityEngine;namespace Oxide.Plugins
    {
        [Info("Armurier", "Babacar", "0.0.1", ResourceId = 0)]
        [Description("Allow a PNJ to become a seller")]
        class Armurier : RustPlugin
        {
            /******************************************/
            /*  OXIDE HOOKS (Plugin Life)             */
            /******************************************/
         
            //-------------------------------------------------------------------------------
            // void Init():
            //-------------------------------------------------------------------------------
            // On plugin initializing sets up the plugin by checking/registering permissions
            // and initializing variables that are not already initialized.
            //-------------------------------------------------------------------------------
            void Init()
            {
                pluginPrefix = (this.Title + " v" + this.Version).ToString();
            }
         
            void OnUseNPC(BasePlayer npc, BasePlayer player)
            {
                var items = ItemManager.GetItemDefinitions();
                if (items == null)
                    return false;
                var newMenu = new Dictionary<string, int>();
                foreach (var item in items)
                {
                    newMenu.Add(Convert.ToString(item.shortname), 2);
                    SendReply(player, string.Format(item.shortname));
                }
            }
        }
    }
    Can you help me with my error?
    Thanks
     
  2. void methods cannot return a value like you did with "return false;" you only can use "return;" or you change the method from void to bool, but that will also need something like "return true;" at the end of the method...
     
  3. I would like display a menu when the player interacts with the NPC and either drop an item to the player inventory with the selected item on the menu.
    Is this possible with this hook in void ?
     
  4. yes ofc it is possible
    just replace: return false;
    by return;
     
  5. thanks the problem is resolve.
    thank-you for your prompt response