Jump to content
  • 0

[REQ]Php Gm List


Question

Posted

Hello, i am trying to make an php script to show the gamemasters of the server, but i get error!

So, if someone can help me with that please!!

I want to show the name and if is online or offline! Thanks very much!

3 answers to this question

Recommended Posts

  • 0
Posted

We are not clairvoyants to know what kind of error you had. We cant help you without error logs or proper description.

  • 0
Posted

GM.PHP

 

<?php
include("config/config.php");
mysql_connect($L2JBS_config["mysql_host"],$L2JBS_config["mysql_login"],$L2JBS_config["mysql_password"]) or die('Cannot connect to mysql server.');
mysql_select_db($L2JBS_config["mysql_db"]) or dir('Cannot connect to the database.');

//Οξλσχΰεμ δΰννϋε θη αΰηϋ
$data=mysql_query("SELECT * FROM characters WHERE $where AND accesslevel>0 ORDER BY    level   DESC LIMIT $top") or die('Cannot get information from databse.');

//Ηΰγξλξβξκ
echo '<br><center><b>..:: GameMasters List ::..</b></center><br><hr>';
echo "<center><table><thead><tr><th>Ή |</th><th>Face |</th><th><center>Nick |</center></th><th>Status |</th><th>Leave Message</th><tr></thead>\n";
//Βϋβξδθμ ρξδεπζθμξε ςΰαλθφϋ
$result2 = mysql_query("SELECT clan_id,clan_name FROM clan_data", $link)
    or die ("Error: ".mysql_error());
  while ($row2=mysql_fetch_row($result2))
    $clans_array[$row2[0]]=$row2[1];
  $clans_array[0]="";
$n=1;
while ($top=mysql_fetch_array($data))
{

if ($top['sex']==0) { $name=''.$top[char_name].'</font>'; } else { $name='<font color=#FF8080>'.$top[char_name].'</font>'; }
$class=mysql_fetch_array(mysql_query("select ClassName from char_templates where ClassId=$top[classid]"));
if (($top['sex']==0) && ($top['race']==4)) { $img='face/dwarf_male.gif'; }
if (($top['sex']==1) && ($top['race']==4)) { $img='face/dwarf_female.gif'; }
if (($top['sex']==0) && ($top['race']==2)) { $img='face/darkelf_male.gif'; }
if (($top['sex']==1) && ($top['race']==2)) { $img='face/darkelf_female.gif'; }
if (($top['sex']==0) && ($top['race']==0)) { $img='face/human_male.gif'; }
if (($top['sex']==1) && ($top['race']==0)) { $img='face/human_female.gif'; }
if (($top['sex']==0) && ($top['race']==1)) { $img='face/elf_male.gif'; }
if (($top['sex']==1) && ($top['race']==1)) { $img='face/elf_female.gif'; }
if (($top['sex']==0) && ($top['race']==3)) { $img='face/orc_male.gif'; }
if (($top['sex']==1) && ($top['race']==3)) { $img='face/orc_female.gif'; }
if ($top['online']==1) {$online='<font color=green>Online</font>'; } 
else {$online='<font color=red>Offline</font>'; } 
echo "<tr><td><b><center>$n</center></b></td><td><img src='$img'></td><td> $name</td><td>$online</td><td><a href=msg.php>Message</a></td></tr>\n";
$n++;
}
//Ηΰκπϋβΰεμ ςΰαλθφσ
echo '</table>';
?></center>

config.php

 

<?php
$L2JBS_config["mysql_host"]="localhost";	// MySQL IP
$L2JBS_config["mysql_port"]=3306;		// MySQP port
$L2JBS_config["mysql_db"]="l2jdb";		// l2jdb or your lineage 2 server database name
$L2JBS_config["mysql_login"]="root";		// MySQL Login name	
$L2JBS_config["mysql_password"]="root";		// MySQL Password
$htitle="Server Name";				// Site Title
$fut="Copyright by Spidey(lol)<br>2010";		// You can change only server name . You must leave Napas © 
$top="100";					// How many players must be in top100
$hserver="127.0.0.1";				// Server IP
$portgame="7777";				// Game Server Port
$portlogin="2106";				// Server Port
$where='1=1';					
$shat="c:/server/l2j/gameserver/log/chat.log";

//Skin
$skin1="pecha";					// Skin

//Serever Rates
$exp="1";
$sp="2";
$adena="3";
$items="5";
$spoil="1";


include("_config_procs.php");
error_reporting(0);
?>

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...