Jump to content

Recommended Posts

Posted

 

call looking for a website with scripts
 
player online
serveronline
login online
top pvp

 

Players Online PHP Code

<?php
   $server_ip = "";
   $mysql_user = "";
   $mysql_pass = "";
   $database = "";
   
   $connect = mysql_connect("$server_ip", "$mysql_user", "$mysql_pass") or die(mysql_error()); 
   $db_select = mysql_select_db("$database", $connect) or die(mysql_error());
   $query = mysql_query("SELECT online FROM characters WHERE online=1") or die(mysql_error()) ;
   
   $online_chars = mysql_num_rows($query);
   
   echo 'Players Online:'.$online_chars;
?>

Server Online (Propably you if server is online..., this is for login server and gameserver too)

<?php
   $server_ip = "localhost";
   $loginserver_port = "7777";
   $gameserver_port = "2106";

   $login_status = @fsockopen( "$server_ip" , "$loginserver_port", $errno, $errstr, 0);
   $game_status = @fsockopen( "$server_ip" , "$gameserver_port", $errno, $errstr, 0);
   
              if($login_status){
      echo"Login:   Online<br />";
   }
   else{
      echo"Login::   Offline<br />";   
   }
   if($game_status){
      echo" Game:   Online<br />";
   }
   else{
      echo" Game:   Offline<br />";
   };
?>

Top Pvp

<table width="250px;">
<?php
	$connection = mysql_connect("SERVER IP", "MYSQL USER", "MYSQL PASSWORD") or die("Connection isn't available!");
	mysql_select_db("MYSQL DATABASE", $connection) or die("Database isn't available!");
	
	
	$q = mysql_query("SELECT * FROM characters WHERE pvpkills > 0 AND accesslevel = 0 ORDER BY pvpkills DESC LIMIT 10");
	$i = 1;
	if ($q) {
		while ($char = mysql_fetch_array($q))
		{
			echo "<tr>";
			echo "<td style='width:11px;color:#000;'>" . $i . ".</td>";
			echo "<td style='width:20px;color:#000;'>" . $char['char_name'] . "</td>";
			echo "<td style='width:20px;text-align:right;padding-left:22px;color:#000;'>" . $char['pvpkills'] . "</td>";
			echo "</tr>";
			$i++;
		}
	}
?>

Top Pk

 

 

<table width="250px;">
<?php
	$connection = mysql_connect("SERVER IP", "MYSQL USER", "MYSQL PASSWORD") or die("Connection isn't available!");
	mysql_select_db("MYSQL DB", $connection) or die("Database isn't available!");
	
	
	$q = mysql_query("SELECT * FROM characters WHERE pkkills > 0 AND accesslevel = 0 ORDER BY pkkills DESC LIMIT 10");
	$i = 1;
	if ($q) {
		while ($char = mysql_fetch_array($q))
		{
			echo "<tr>";
			echo "<td style='width:11px;color:#000;'>" . $i . ".</td>";
			echo "<td style='width:20px;color:#000;'>" . $char['char_name'] . "</td>";
			echo "<td style='width:20px;text-align:right;padding-left:22px;color:#000;'>" . $char['pkkills'] . "</td>";
			echo "</tr>";
			$i++;
		}
	}
?>

You can find more scripts over here

Guest
This topic is now closed to further replies.


×
×
  • Create New...