<?php
ob_start();
require_once('var/ustawienia.php');
session_start();
function gracz3($sesja){ 
	if(!empty($sesja)  && is_numeric($sesja)){ 
		$gracz = mysql_fetch_array(mysql_query("select *, (select count(*) from endless_gracze g where g.exp > exp) as pozycja from endless_gracze where gracz = ".$sesja)); 
	}
	
	return $gracz ; 
}

$oGracz3= gracz3($_SESSION['gracz']);


$ludki = mysql_query("select gracz,login,x,y from endless_gracze where online + 300 > ".time()." and mapa_id = ".$oGracz3['mapa_id']." and gracz != ".$oGracz3['gracz']);
while($t = mysql_fetch_array($ludki)){
	$x = ($t['x']-1)*60;
	$y = ($t['y']-1)*60;
	echo "
	<div class='players' id='player".$t['gracz']."' style='top:".$y."px; left:".$x."px; z-index:20' >
		<div class='name' style='color:#FF0000'>~".$t['login']."~</div>
	</div>
	<script>
		var xxx = document.getElementById('player".$t['gracz']."');
		if(xxx) { 
			xxx.style.display = 'none';
			xxx.style.display = 'block';
		}
	</script>
	";
}
ob_end_flush();
?>