Infinite loop...

Infinite loop...

Postby Warren1001 » 19 Jul 2013, 06:19

Not really infinite, but occurs 2-3 times each time...
Code: Select all
            if (!File.ReadAllText(path).Contains(e.Player.name))
            {
               e.Player.frozen = true;
               e.Player.muted = true;
               Thread.Sleep(2000);
               Player.SendMessage(e.Player, "Read over the rules and type /agree to agree to them.");
               Thread.Sleep(5000);
               Command.all.Find("rules").Use(e.Player, "");
            }

In the Init method, using Player.Joined.
When I join, I see the P.SM instantly, then the 2nd thread.sleep kicks in, and then i get the p.sm and the thread.sleep(5000) etc, with the rules occuring both times. THEN the first thread.sleep kicks it and the cycle begins, and then it stops. Anyway to make this stop? I've tried inside the if (!file.read...etc) a if (!e.Player.frozen) and a if (e.Player.frozen == false) and then the other stuff inside it, and I still get the same results...
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50

Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron