Solved Item IDs from BluePrints?

Discussion in 'Rust Development' started by TheRotAG, Jan 21, 2015.

  1. Hi there guys.

    Tried to find the Item IDs from each blueprint without success... used the code from Shop and Give plugins in order to try that, but global.ItemManager.GetItemDefinitions(), from what I studied from these plugins, can only print me the item Name and ID. When I call the blueprints it print me something like [Oxide] 3:39 AM [Info] System.Collections.Generic.List`1[ItemBlueprint]: 1964914944

    Would that big number be the ID?

    My intention is to allow my players to buy the BPs in the server shop.
     
  2. The id is the same as the item id..It is based on the field set on the item.
    Code:
    local item = global.ItemManager.CreateByName(ITEM_NAME, 1);
    item.isBlueprint = true; --Set to true for blueprint
    local inv= player.inventory;
    inv:GiveItem(Item, nil);
    or
    Code:
    local item = global.ItemManager.CreateByItemId(itemId, amount, true) --True if the item should be a blueprint
    local inv= player.inventory;
    inv:GiveItem(Item, nil);