I'm not sure if it will be okay with MCDzienny, but I think when players disconnect they instantly become 'null'. So 'p.group' will not be anything, as p is null, null doesn't have a group. So you cannot demote the player.
Unless you use setrank and the players name, like I previously suggested, which can rank offline players.
So you just need to target this bit of code:
- Code: Select all
Thread.Sleep(time);
Player.GlobalMessage(who.color+who.name+" %awas reverted to their original rank.");
who.group = oldGroup;
who.color = oldGroup.color;
But I'm not 100% sure on the Player variable become null on disconnect, but I'm pretty sure about it, so its better to be safe than sorry, or you can run some tests
If you leave the code as it is, you could have some (temporary) ranked players staying permanent O: