Cannot convert `int' expression to type `ulong'Solved
I keep getting that error... it doesn't like the 1 on var testspawn = ItemManager.CreateByItemID(testids[rnd], 1, testskins[rnd]);
But I need it for amount. Does anyone have any idea how to fix it? Been spending several hours trying to figure it out to no avail. Thanks. :)

using UnityEngine;
using System.Collections.Generic;

namespace Oxide.Plugins
{
    [Info("Test", "me", 0.1)]
    [Description("test")]

    class Test : RustPlugin
    {
	void OnEntitySpawned(BaseEntity entity)
	{
	if (entity is NPCPlayerCorpse) {
	PlayerCorpse corpse = entity.GetComponent<PlayerCorpse>();
	{
	var rnd = Random.Range(0, testids.Count);
	var testspawn = ItemManager.CreateByItemID(testids[rnd], 1, testskins[rnd]);
	timer.Once(0.5f, () =>
	{
	testspawn.MoveToContainer(corpse.containers[0]);
	});
	}
	}
	}
	List<int> testids = new List<int>
	{
	-1211618504,
	106433500,
	-1397343301,
	-46188931,
	115739308,
	2107229499
	};
	List<int> testskins = new List<int>
	{
	889718910,
	889714798,
	10058,
	889712013,
	1106600389,
	920390242
	};
	}
}​

ItemManager.CreateByItemID expects a ulong, you're trying to pass an int. You can either store your values as ulongs, else convert your int to ulong where you are using it.

Changed everything to ulong... still same error...

using UnityEngine;
using System.Collections.Generic;

namespace Oxide.Plugins
{
    [Info("Test", "me", 0.1)]
    [Description("test")]

    class Test : RustPlugin
    {
	void OnEntitySpawned(BaseEntity entity)
	{
	if (entity is NPCPlayerCorpse) {
	PlayerCorpse corpse = entity.GetComponent<PlayerCorpse>();
	{
	ulong rnd = Random.Range(0, testids.Count);
	ulong amnt = 1;
	ulong testspawn = ItemManager.CreateByItemID(testids[rnd], amnt, testskins[rnd]);
	timer.Once(0.5f, () =>
	{
	testspawn.MoveToContainer(corpse.containers[0]);
	});
	}
	}
	}
	List<ulong> testids = new List<ulong>
	{
	-1211618504,
	106433500,
	-1397343301,
	-46188931,
	115739308,
	2107229499
	};
	List<ulong> testskins = new List<ulong>
	{
	889718910,
	889714798,
	10058,
	889712013,
	1106600389,
	920390242
	};
	}
}​
I can't imagine it's the same error with those changes.
In response to Wulf ():
I can't imagine it's the same error with those changes.
Error while compiling: Test.cs(34,3): error CS1503: Argument `#1' cannot convert `int' expression to type `ulong'

Merged post

Can't believe I didn't think of that earlier... JustDecompile and voila... it requires int for id, int for amount and ulong for skin... solved. :)
Locked automatically