lundi 7 août 2017

trying to give players items every 5 mins but to only randomly 1 player if the room id is 20+

getting problem in choosing player randomly.Error is cannot convert int to MyGame.player. Any Suggestion what should i try to do ?

foreach (Player p in Players)
{
    if (PlayerCount == 20)
    {
        AddTimer(delegate
        {
            try
            {
               var lol = p;
               Random check = new Random();
               lol = check.Next(0, 20);                  
            }
            catch (ArgumentOutOfRangeException)
            { }
        }, 300000);
    }
}




Aucun commentaire:

Enregistrer un commentaire