Ok now i gonna creazy...
If i switch the weapons in my belt and zoom with the scope i get the console error in rust: More than one viewmodel active at the same time. After this message i cant zoom anymore and a pice of my player stands on the old position?!
WTF?
I creat the weapon with:
Whats wrong. Is it a rust bug?Code:private Item makeItem(string shortname, int amount, bool zoom, int id) { var definition = ItemManager.FindItemDefinition(shortname); if (definition != null) { Item item = ItemManager.CreateByItemID((int)definition.itemid, amount); if (id == 0) { } else { item.skin = id; } if (zoom == true) { item.contents.AddItem(makeItem("weapon.mod.small.scope", 1, false, 0).info, 1); } return item; } return null; } [ChatCommand("test")] void test(BasePlayer player, string command) { player.inventory.containerBelt.itemList.Clear(); player.inventory.GiveItem(makeItem("rifle.bolt", 1, true, 0), player.inventory.containerBelt); }
[DOUBLEPOST=1472581375][/DOUBLEPOST]Update: if i use the chat command test, this error comes. it create every i typ test a new viewmodel from me. but why?
Solved More than one viewmodel active at the same time
Discussion in 'Rust Development' started by Sir BenSon, Aug 30, 2016.
-
Attached Files:
Last edited by a moderator: Aug 30, 2016 -
-
Update 2:
I createt a new plugin only with this test command. And the error is the same:
Output rust console and exceptions:Attached Files:
-
-
Update 3:
Now i made some tests. it occurs only when you remove the aktiv scope in your hand via player.inventory.containerBelt.itemList.Clear(); so how to clear the item in the players hand? -
fixed it. works now


