• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent deleted thread

Isn't there a code for "onLook"? to see the ranks next to their level/vocation display?
 
Nice release teckman!
Simple and usefull, but can be more developed :p!
 
hey is possible add to my web site?

Name*****Frags*****Rank

here is my top fragers
PHP:
<?php
$main_content .= '<div style="text-align: center; font-weight: bold;">Top 30 Frags on ' . $config['server']['serverName'] . '</div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
	<tr bgcolor="' . $config['site']['vdarkborder'] . '">
		<td class="white" style="text-align: center; font-weight: bold;">Name</td>
		<td class="white" style="text-align: center; font-weight: bold;">Frags</td>
	</tr>';

$i = 0;
foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags`
	FROM `killers` k
	LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
	LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
WHERE `k`.`unjustified` = 1
	GROUP BY `name`
	ORDER BY `frags` DESC, `name` ASC
	LIMIT 0,30;') as $player)
{
	$i++;
	$main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']) . '">
		<td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '">' . $player['name'] . '</a></td>
		<td style="text-align: center;">' . $player['frags'] . '</td>
	</tr>';
}

$main_content .= '</table>';
?>
 
@up:
Try this:
PHP:
<?php 
$getranks = array(
			5 => "Private First Class",
			10 => "Specialist",
			15 => "Corporal",
			20 => "Sergeant",
			25 => "Staff Sergeant",
			30 => "Sergeant First Class",
			35 => "Master Sergeant",
			40 => "First Sergeant",
			45 => "Sergeant Major",
			50 => "Command Sergeant Major",
			55 => "Sergeant Major of the Army",
			60 => "Second Lieutenant",
			65 => "First Lieutenant",
			70 => "Captain",
			75 => "Major",
			80 => "Lieutenant Colonel",
			90 => "Colonel",
			100 => "Brigadier General",
			115 => "Major General",
			120 => "Lieutenant General",
			140 => "General",
			170 => "General of the Army");
$storkey = 600;

$main_content .= '<div style="text-align: center; font-weight: bold;">Top 30 Frags on ' . $config['server']['serverName'] . '</div> 
<table border="0" cellspacing="1" cellpadding="4" width="100%"> 
    <tr bgcolor="' . $config['site']['vdarkborder'] . '"> 
        <td class="white" style="text-align: center; font-weight: bold;">Name</td> 
        <td class="white" style="text-align: center; font-weight: bold;">Frags</td> 
		 <td class="white" style="text-align: center; font-weight: bold;">Rank</td> 
    </tr>'; 

$i = 0; 
foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags` 
    FROM `killers` k 
    LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` 
    LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` 
WHERE `k`.`unjustified` = 1 
    GROUP BY `name` 
    ORDER BY `frags` DESC, `name` ASC 
    LIMIT 0,30;') as $player) 
{ 
    $i++; 
    $player_id = $player['id'];
    $playerStorageValue = $SQL->query('SELECT value FROM player_storage WHERE player_id='$player_id' AND key='$storkey'');   
    $getTitleRank = getranks[$playerStorageValue];  
    $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']) . '"> 
        <td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '">' . $player['name'] . '</a></td> 
        <td style="text-align: center;">' . $player['frags'] . '</td> 
		 <td style="text-align: center;">' . $getRankTitle . '</td> 
    </tr>'; 
} 

$main_content .= '</table>'; 
?>
 
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\fragers.php on line 47
 
Change the: $playerStorageValue
to:
PHP:
$playerStorageValue = $SQL->query('SELECT `value` FROM `player_storage` WHERE `player_id` = ' . $player_id . ' AND `key` = ' . $storkey . '');

And try.
 
Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\fragers.php on line 48
 
Afffff xd
PHP:
<?php 
$getranks = array(
            5 => "Private First Class",
            10 => "Specialist",
            15 => "Corporal",
            20 => "Sergeant",
            25 => "Staff Sergeant",
            30 => "Sergeant First Class",
            35 => "Master Sergeant",
            40 => "First Sergeant",
            45 => "Sergeant Major",
            50 => "Command Sergeant Major",
            55 => "Sergeant Major of the Army",
            60 => "Second Lieutenant",
            65 => "First Lieutenant",
            70 => "Captain",
            75 => "Major",
            80 => "Lieutenant Colonel",
            90 => "Colonel",
            100 => "Brigadier General",
            115 => "Major General",
            120 => "Lieutenant General",
            140 => "General",
            170 => "General of the Army");
$storkey = 600;

$main_content .= '<div style="text-align: center; font-weight: bold;">Top 30 Frags on ' . $config['server']['serverName'] . '</div> 
<table border="0" cellspacing="1" cellpadding="4" width="100%"> 
    <tr bgcolor="' . $config['site']['vdarkborder'] . '"> 
        <td class="white" style="text-align: center; font-weight: bold;">Name</td> 
        <td class="white" style="text-align: center; font-weight: bold;">Frags</td> 
         <td class="white" style="text-align: center; font-weight: bold;">Rank</td> 
    </tr>'; 

$i = 0; 
foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags` 
    FROM `killers` k 
    LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` 
    LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` 
WHERE `k`.`unjustified` = 1 
    GROUP BY `name` 
    ORDER BY `frags` DESC, `name` ASC 
    LIMIT 0,30;') as $player) 
{ 
    $i++; 
    $player_id = $player['id'];
    $playerStorageValue = $SQL->query('SELECT `value` FROM `player_storage` WHERE `player_id` = ' . $player_id . ' AND `key` = ' . $storkey . '');   
    $getTitleRank = $getranks[$playerStorageValue];  
    $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']) . '"> 
        <td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '">' . $player['name'] . '</a></td> 
        <td style="text-align: center;">' . $player['frags'] . '</td> 
         <td style="text-align: center;">' . $getTitleRank. '</td> 
    </tr>'; 
} 

$main_content .= '</table>'; 
?>
 
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `key` = 600' at line 1' in C:\xampp\htdocs\fragers.php:47 Stack trace: #0 C:\xampp\htdocs\fragers.php(47): PDO->query('SELECT `value` ...') #1 C:\xampp\htdocs\index.php(452): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\fragers.php on line 47
 
ey there is a bug in this script gods and gms also have military ranks :D i tried to fix it but im not so familiar with mods :D
 
Afffff xd
PHP:
<?php 
$getranks = array(
            5 => "Private First Class",
            10 => "Specialist",
            15 => "Corporal",
            20 => "Sergeant",
            25 => "Staff Sergeant",
            30 => "Sergeant First Class",
            35 => "Master Sergeant",
            40 => "First Sergeant",
            45 => "Sergeant Major",
            50 => "Command Sergeant Major",
            55 => "Sergeant Major of the Army",
            60 => "Second Lieutenant",
            65 => "First Lieutenant",
            70 => "Captain",
            75 => "Major",
            80 => "Lieutenant Colonel",
            90 => "Colonel",
            100 => "Brigadier General",
            115 => "Major General",
            120 => "Lieutenant General",
            140 => "General",
            170 => "General of the Army");
$storkey = 600;

$main_content .= '<div style="text-align: center; font-weight: bold;">Top 30 Frags on ' . $config['server']['serverName'] . '</div> 
<table border="0" cellspacing="1" cellpadding="4" width="100%"> 
    <tr bgcolor="' . $config['site']['vdarkborder'] . '"> 
        <td class="white" style="text-align: center; font-weight: bold;">Name</td> 
        <td class="white" style="text-align: center; font-weight: bold;">Frags</td> 
         <td class="white" style="text-align: center; font-weight: bold;">Rank</td> 
    </tr>'; 

$i = 0; 
foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags` 
    FROM `killers` k 
    LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` 
    LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` 
WHERE `k`.`unjustified` = 1 
    GROUP BY `name` 
    ORDER BY `frags` DESC, `name` ASC 
    LIMIT 0,30;') as $player) 
{ 
    $i++; 
    $player_id = $player['id'];
    $playerStorageValue = $SQL->query('SELECT `value` FROM `player_storage` WHERE `player_id` = ' . $player_id . ' AND `key` = ' . $storkey . '');   
    $getTitleRank = $getranks[$playerStorageValue];  
    $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']) . '"> 
        <td><a rel="nofollow" href="?subtopic=characters&name=' . urlencode($player['name']) . '">' . $player['name'] . '</a></td> 
        <td style="text-align: center;">' . $player['frags'] . '</td> 
         <td style="text-align: center;">' . $getTitleRank. '</td> 
    </tr>'; 
} 

$main_content .= '</table>'; 
?>




Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `key` = 600' at line 1' in C:\xampp\htdocs\fragers.php:47 Stack trace: #0 C:\xampp\htdocs\fragers.php(47): PDO->query('SELECT `value` ...') #1 C:\xampp\htdocs\index.php(452): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\fragers.php on line 47


sorry for no wait the time for bump please help me..
 
Back
Top