mardi 10 avril 2018

Random.Next C# doesnt work like i want

I try to create a daily reward system. But i got one problem.

First the code :

Random rndDailyItem = new Random();
short[] itemIds = { 9023, 9041 };
rndDailyItem.Next(0, itemIds.Length);

So, the problem is: I want the "itemIds" as output, but the output i got for now is just 0 or 1, what did i wrong?

The "rest" of the code is this:

CharacterId, Convert.ToInt16(rndDailyItem.Next(0, itemIds.Length)), 
Convert.ToByte(rndDailyAmount.Next(0, itemAmount.Length)), 0, 0, false);




Aucun commentaire:

Enregistrer un commentaire