Hello I am trying to use Playerutill::maxPlanetCount function to show each player how much colonys he can get, but i get error.
The code I use:
I know code is not the best but still I am getting error about factors.
The PlayerUtil
The code I use:
I know code is not the best but still I am getting error about factors.
The PlayerUtil
PHP Source Code
- static public function maxPlanetCount($USER) { global $resource; $config = Config::get($USER['universe']); $planetPerTech = $config->planets_tech; $planetPerBonus = $config->planets_officier; if($config->min_player_planets == 0) { $planetPerTech = 999; } if($config->min_player_planets == 0) { $planetPerBonus = 999; } // http://owiki.de/index.php/Astrophysik#.C3.9Cbersicht return (int) ceil($config->min_player_planets + min($planetPerTech, $USER[$resource[124]] * $config->planets_per_tech) + min($planetPerBonus, $USER['factor']['Planets'])); }