Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

About topPK.php Counts

Experienced Elementalist
Joined
Mar 25, 2010
Messages
244
Reaction score
13
//request


may anyone share the .php script for TOP PK in your server .
which is depends in number of kills. during CW time or using force pk (pressing z)..


thanks co rz mates.. thanks in advance.. :8:
 
Experienced Elementalist
Joined
Mar 25, 2010
Messages
244
Reaction score
13
may you share the .php script ?

anyone ? please

may anyone know about my problem for pk counts .. please help , thanks ...
 
Last edited by a moderator:
Upvote 0
Joined
Sep 16, 2007
Messages
1,206
Reaction score
541
@eu`CutterEye
this is it :): put it on \modules\ save it as toppk.php
Code:
<head><script type="text/javascript" src="disableSelect.js"></script></head><?
require("config.php");
function getC ($int) {
    if ($int == 1) { $char = "Fighter(M)"; }
    if ($int == 2) { $char = "Kendo(M)"; }
    if ($int == 4) { $char = "Archer(F)"; }
    if ($int == 8) { $char = "QiGong(F)"; }
    if ($int == 16) { $char = "Extreme(M)"; }
    if ($int == 32) { $char = "Extreme(F)"; }
    if ($int == 64) { $char = "Fighter(F)"; }
    if ($int == 128) { $char = "Kendo(F)"; }
    if ($int == 256) { $char = "Archer(M)"; }
    if ($int == 512) { $char = "Shaman(M)"; }
return $char;
}
function getO ($int) {
    if ($int == 0) { $char = "<img src='/images/offline.png'>"; }
    if ($int == 1) { $char = "<img src='/images/online.png'>"; }
return $char;
}
function getG ($int) {
    if ($int == "0") { $char = "NONE"; }
return $char;
}


$i=0;
$resTop = mssql_query("SELECT TOP 50 P.ChaName, P.ChaLevel, P.ChaOnline, P.ChaPK2, P.ChaSchool, P.ChaReborn, P.GuNum, P.ChaNum FROM RanGame1.dbo.ChaInfo P, RanUser.dbo.UserInfo U WHERE P.UserNum = U.UserNum AND U.UserType != 30 AND P.ChaDeleted != 1 AND P.ChaPK2 != 0 ORDER BY P.ChaPK2 DESC, P.ChaLevel DESC");
while($result = mssql_fetch_array( $resTop )) {
	$i++;		

			$Name = $result["ChaName"];
			$lev = $result["ChaLevel"];
			$Reborn = $result["ChaReborn"];
			$chapk2 = $result["ChaPK2"];
			$Num = $result["ChaNum"];
			$ol = $result["ChaOnline"];
			if($ol == 0) {
				$ol = getO($ol);
			}
    			if($ol == 1) {
				$ol = getO($ol);
			}
			$id = $result["GuNum"];
    			if($class == 1) {
				$class = getC($class);
			}
    			if($class == 2) {
				$class = getC($class);
			}
    			if($class == 4) {
				$class = getC($class);
			}
    			if($class == 8) {
				$class = getC($class);
			}
    			if($class == 16) {
				$class = getC($class);
			}
    			if($class == 32) {
				$class = getC($class);
			}
			if($class == 64) {
				$class = getC($class);
			}
    			if($class == 128) {
				$class = getC($class);
			}
    			if($class == 256) {
				$class = getC($class);
			}
    			if($class == 512) {
				$class = getC($class);
			}
    			if($id == 0) {
				$GuildName = getG($id);
			}


$resTop1 = mssql_query("SELECT GuName from RanGame1.dbo.GuildInfo Where GuNum = '$id' ");

while($result1 = mssql_fetch_array( $resTop1 )) {
			

			$GuildName = $result1["GuName"];


}

  			




echo"  						<tr class='li01' height='25'>
							<td width='112' align='center' style='border-bottom:#CCCCCC 1px dashed'>$i</td>
							<td width='158' style='border-bottom:#CCCCCC 1px dashed' align='center'>$Name</td>
							<td width='140' align='center' style='border-bottom:#CCCCCC 1px dashed'>$lev</td>
							<td width='98' align='center' style='border-bottom:#CCCCCC 1px dashed'>$GuildName</td>
							<td width='100' align='center' style='border-bottom:#CCCCCC 1px dashed'>$chapk2</td>

							<td width='140' align='center' style='border-bottom:#CCCCCC 1px dashed'>$ol</td>
</tr>




";


}

?>

PS: to create it as

create a copy of your rank.php, and name it chapk.php then find this code:

Code:
<? include_once("modules/rankings.php"); ?>

change that rankings.php to toppk.php :)
 
Last edited:
Upvote 0
Experienced Elementalist
Joined
Mar 25, 2010
Messages
244
Reaction score
13
thanks seifer i will try this one ..

but do i need to add column in my dbase? or not ?


i got error


Code:
Warning: mssql_query(): Unable to connect to server: (null) in C:\Program Files\Abyss Web Server\htdocs\rancp1\toppk.php on line 28

Warning: mssql_query(): A link to the server could not be established in C:\Program Files\Abyss Web Server\htdocs\rancp1\toppk.php on line 28

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in C:\Program Files\Abyss Web Server\htdocs\rancp1\toppk.php on line 29
 
Last edited:
Upvote 0
Back
Top