PHP: if($this->getServer()->isLevelLoaded(/*LevelName*/)){$this->getServer()->unloadLevel(/*levelname*/);}if(!$this->getServer()->isLevelLoaded(/*LevelName*/)){$this->getServer()->loadLevel(/*LevelName*/);}
i think this is better PHP: $this->getServer()->unloadLevel(/*levelname*/);$this->getServer()->loadLevel(/*LevelName*/); because isLevelLodaded() method is impleented in unload/loadLevel too
How? Do you even know how infinite loops work and run? Please don't post if you don't know what you're talking about. It is always good to check if a level is loaded before unloading it, and vice versa.
The code checks if the level is loaded, if true it unloads the level. It then checks to see if the level is unloaded, if true it will load the level. So that means that each time the level is loaded, it will be unloaded, and when it is unloaded it will be loaded again. Causing an infinite loop of reloading.
Incorrect. It will bypass the secondary if() statement after loading/unloading the level. Code doesn't rewind unless you tell it to.