Jump to content
  • 0

Website, Raid Map need help


Question

Posted (edited)

Hello guys, sorry if i post is wrong section, but i need help with web coding, i upload to my web LIVE RAID MAP, i use ACIS, i make new SQL for raid names so i have names on map, but all Grand Bosses map shows DEAD. Can anyone give me advice how to fix this please. 

I upload code below : 

 

Quote

 

<html>
<head>
<body bgcolor="#000000" text="lime" link="#009933" vlink="#009933" padding="0" leftmargin="0">
<font size="2"> 
<TITLE>Live Raid Boss Map</TITLE>

<script>
<!--
//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="5:00"

if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{ 
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes "+cursec+" seconds to automatic refresh!"
else
curtime=cursec+" seconds to automatic refresh!"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}

window.onload=beginrefresh
//-->
</script>

</head>
<?php
include"connection.php";
?>
<?php
$query_raidbosses=mysql_query("SELECT boss_id,loc_x,loc_y,loc_z,respawn_time FROM raidboss_spawnlist");
$query_grandboss=mysql_query("SELECT boss_id,loc_x,loc_y,loc_z,respawn_time FROM grandboss_data");
$online= mysql_num_rows($query_raidbosses);
$online2= mysql_num_rows($query_grandboss);
echo "<div style=position:absolute;top:0px;left:0px><img src=IL.jpg></div>";
while ($res=mysql_fetch_array($query_raidbosses))
  {
    $id=$res['boss_id'];
    $valx=$res['loc_x'];
    $valy=$res['loc_y'];
    $valz=$res['loc_z'];
    $respawn=$res['respawn_time'];
    $boss_name=mysql_query("SELECT boss_name FROM bossmap WHERE id='$id'");
    $name = mysql_fetch_row( $boss_name );
    $boss_level=mysql_query("SELECT boss_level FROM bossmap WHERE id='$id'");
    $level = mysql_fetch_row( $boss_level );
    
  $x=116+($valx+107823)/200;
  $y=2580+($valy-255420 )/200;
  
if($respawn == "0")
    echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=3.png title=\"(RaidBoss) $name[0] $level[0]lvl Alive!\"></div><center>";
else         
    echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=0.png title=\"(RaidBoss) $name[0] $level[0]lvl Dead!\"></div><center>";
    }
while ($res=mysql_fetch_array($query_grandboss))
  {
    $id=$res['boss_id'];
    $valx=$res['loc_x'];
    $valy=$res['loc_y'];
    $valz=$res['loc_z'];
    $respawn=$res['respawn_time'];
    $boss_name=mysql_query("SELECT boss_name FROM bossmap WHERE id='$id'");
    $name = mysql_fetch_row( $boss_name );
    $boss_level=mysql_query("SELECT boss_level FROM bossmap WHERE id='$id'");
    $level = mysql_fetch_row( $boss_level );
    
  $x=116+($valx+107823)/200;
  $y=2580+($valy-255420 )/200;
  
if($respawn == "0")
    echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=3.png title=\"(GrandBoss) $name[0] $level[0]lvl Alive!\"></div><center>";
else         
    echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=0.png title=\"(GrandBoss) $name[0] $level[0]lvl Dead!\"></div><center>";
    }    
mysql_close();
?>

 

 

Edited by remigas

3 answers to this question

Recommended Posts

  • 0
Posted

first we have 2018 please use PDO cause mysql is deprecated.

second google "inner join" table to get from the grand boss data the time they need to respawn or 0 that means alive if you want it in 1 query.

or just combine id's from 2 queries and respawn time

  • 0
Posted

just check results with, example print_r $row...

and me suggestion dont use web and game server in same server. Use cronjobs for data update, example every 5min.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...