srand(microtime() * 1000000); $Zufall_x = rand(1, $size); $zufall_y = rand(1, $size); $gefunden = 0; while ($gefunden == 0) { $result = $db->query("SELECT * FROM cc" . $n . "_crand where used = '0' and element_type ='0' and x={$Zufall_x} and y={$zufall_y}"); $land = $db->fetch_array($result); $land_x = $land['x']; $land_y = $land['y']; if ($land['used'] == '0') { $gefunden = 1; } else { $gefunden = 0; } } $landkoord = "{$land_x}:{$land_y}"; trace_msg("Admin map change change User Pos county:{$countrie_id} new pos -> {$land_x}:{$land_y}", 112); $sql = "update cc" . $n . "_countries set x='{$Zufall_x}',y='{$zufall_y}' where islandid='{$countrie_id}' "; $update = $db->query($sql); $sql = "update cc" . $n . "_crand set used ='1' where x='{$Zufall_x}' and y='{$zufall_y}' "; $update = $db->query($sql); } trace_msg("Admin map change write Options", 112); $sql = "update cc" . $n . "_menu_admin_opt set value ='{$size}' where varname='op_map_size'"; $update = $db->query($sql); require LITO_ROOT_PATH . "includes/class_options.php"; $option = new option(LITO_ROOT_PATH . "options/"); $option->write(); header("LOCATION: map.php"); exit; }