Quote:
Originally Posted by Eliminationn
Simple!
do something like
Code:
foreach(character C in Game.World._H.Values)
{
//Hmmmmm.......
random code.
}
|
No comments...
You can do a list and make a random with that list.
List<string> Names = new List<string>();
Every time something join, Names.add(player);
And later,
Quote:
Random N = new Random();
int NumberSelected = N.Next(Names.Count);
|
But this gives you a number. You need the player.
You need: using System.Linq; for the next action.
string PlayerSelected = Names.ElementAt(NumberSelected);
Done.