<?
$sql = "select *, (GeoID >> 18) as terID,(GeoID & ((1 << 9) - 1)) as `x`, ((GeoID >> 9) & ((1 << (9)) - 1)) as `y` from `character` where IsActive=1";
$res = mysql_query($sql) or die("sql error: " . mysql_error());
$sum_players = mysql_num_rows($res);
$sum_players=0;
while( $row = mysql_fetch_array($res) ) {
$x=0;
$y=0;
$size = $_POST['size'];
$name = $row['Name']." ".$row['LastName'];
if ($row['terID'] == 442) {
$y=1533-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 443) {
$y=1533-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 444) {
$y=1533-$row['y'];
$x=$row['x']+1022;
}
else if ($row['terID'] == 445) {
$y=1022-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 446) {
$y=1022-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 447) {
$y=1022-$row['y'];
$x=$row['x']+1022;
}
else if ($row['terID'] == 448) {
$y=511-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 449) {
$y=511-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 450) {
$y=511-$row['y'];
$x=$row['x']+1022;
}
print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
}
print "<div style='position: absolute; margin:0; padding: 0; background: green; width: 1px; height: 1px; left: 1px; top:1533px'></div>";
?>
$sql = "select *, (GeoID >> 18) as terID,(GeoID & ((1 << 9) - 1)) as `x`, ((GeoID >> 9) & ((1 << (9)) - 1)) as `y` from `character` where IsActive=1";
$res = mysqli_query($db_handle, $sql) or die("error: " . mysqli_error($db_handle));
$sum_players=0;
while( $row = mysqli_fetch_array($res) ) {
$x=0;
$y=0;
$size = $_POST['size'];
$name = $row['Name']." ".$row['LastName'];
if ($row['terID'] == 442) {
$y=1533-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 443) {
$y=1533-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 444) {
$y=1533-$row['y'];
$x=$row['x']+1022;
}
else if ($row['terID'] == 445) {
$y=1022-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 446) {
$y=1022-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 447) {
$y=1022-$row['y'];
$x=$row['x']+1022;
}
else if ($row['terID'] == 448) {
$y=511-$row['y'];
$x=$row['x'];
}
else if ($row['terID'] == 449) {
$y=511-$row['y'];
$x=$row['x']+511;
}
else if ($row['terID'] == 450) {
$y=511-$row['y'];
$x=$row['x']+1022;
}
print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
}
print "<div style='position: absolute; margin:0; padding: 0; background: green; width: 1px; height: 1px; left: 1px; top:1533px'></div>";
print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
print "<div style='border: 1px solid yellow; background: yellow; left:".($x-(2))."px; top: ".($y-(2))."px; width: 2px; height: 2px; position: absolute;' class='player' title='player: $name' ></div>";
MacDante wrote:Probably is this possibility, but not from my side. I don't use this table on my server and don't change it.
Kortal wrote:Thanks MacDante for your great work.
I have updated a bit the code and added some more other things.
+ updated to mysqli
+ migrated config to a separated file
+ grid on mouse over the map
+ guild members list on mouse over the guild claim
+ optional online count: need to have lifdscp (lif-dedicated-server-control-panel-lifds-cp-t15168/)
+ optional online player list: need to have lifdscp (lif-dedicated-server-control-panel-lifds-cp-t15168/)
+ optional weather display (today and tomorrow): need to copy the cm_weather1.xml file into map folder
css by Jakommo.
download: https://mega.nz/#!k84kwbJI!yet-vK3qqPAh ... RZjPb-XXSY
if (file_exists('./cm_weather1.xml')) {
$data = file_get_contents('./cm_weather1.xml', true);
$pos = strpos($data, "=" . $daynumber .">");
$weather=substr($data, $pos+2+strlen($daynumber), 15);
$weather=substr($weather, 0, strpos($weather,"<"));
$daynumber2 = $daynumber + 1;
if ($daynumber == 364) { $daynumber2 = 1;}
$pos = strpos($data, "=" . $daynumber2 .">");
$weather2=substr($data, $pos+2+strlen($daynumber2), 15);
$weather2=substr($weather2, 0, strpos($weather2,"<"));
$infos = $infos . "Погода: " . $weather ." (завтра:". $weather2 . ")<br />";
Dragodor wrote:Hello,
it works fine!
But 2 questions:Best Wishes,
- I can't find the "cm_weather1.xml". Where do I have to download it?
- How can I deactivate the player names in the claim-tooltips?
Dragodor
Tried messing around with the weather, assuming the format must have been changed as it doesnt seem to work anymore.Steam\steamapps\common\Life is Feudal Your Own Dedicated Server\data\weather
Should remove the names from being displayed, tho the popup will still show up{$guildmembers = $guildmembers . $db_field['Name'] . " " . $db_field['LastName'] . ", "; }