• 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!

HalfAway

Thanatos
Joined
Sep 3, 2011
Messages
3,795
Solutions
26
Reaction score
2,612
Location
Sweden
GitHub
HalfAway
I converted this script to ZnoteAAC because of a request here Solved - [Znote v1.5] Most Creature Killers

The script was orginally coded by @Zonet.

Code:
PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';

/*
    Script by zonet.
    Converted to ZnoteAAC by HalfAway.
*/

// Creature array (name + storage).
$kills = array(
            'dragon' => 9541,
            'dragon lord' => 9542,
            'frost dragon' => 9543,
            'wyrm' => 9544,
            'demon' => 9545
            );

// Limits the list of killers for each creature
$limit = 6;

echo '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
        <tr bgcolor="#505050" style="color: white;"><th width="10%">Creature</th><th>Creature Name</th><th>Top Killers (Max: '.$limit.')</th></tr>';
    $row = 1;
    foreach($kills as $name => $storage) {
        $monterq = mysql_select_multi('SELECT `player_storage`.`player_id`, `player_storage`.`key`, `player_storage`.`value` AS `value`, `players`.`id`, `players`.`name` AS `name`
            FROM `player_storage` LEFT JOIN `players` ON `player_storage`.`player_id` = `players`.`id` WHERE `player_storage`.`key` = '.$storage.' ORDER BY ABS(value) DESC LIMIT '.$limit);

        echo '<tr><td><img src="monsters/'.(str_replace(" ", "" , $name)).'.gif"></td><td width="20%" style="font-size: 13pt; font-weight: bold; color: darkorange;"><center>'.(ucwords($name)).'</center></td><td>';
        $a = 0;
        foreach($monterq as $q) {
            $a++;
            if($a == 1)
                echo '<font color="green">';
            if($a == $limit)
                echo '<font color="red">';
            if($a == $limit / 2)
                echo '<font color="darkorange">';

            echo '<b>'.$a.'. Name:</b> <a href="characterprofile.php?name='.urlencode($q['name']).'">'.$q['name'].'</a> (Kills:  '.$q['value'].') </font></font></font><br />';
        }
        echo '</tr>';
    }
    echo '</td></table>';

include 'layout/overall/footer.php'; ?>
You need to add the images into a folder named monsters inside your www directory.

Image
http://www.************/MonsterKills.png
 

Attachments

  • MonsterKills.png
    MonsterKills.png
    106.3 KB · Views: 227 · VirusTotal
Last edited:
Nice work! Thanks for contributing this mate :)
 
Another quick question, where should I put the script at? :)
Which file is it :p

Thanks for the assitance HA~
Create a file in the home dir (same as other pages) and name the file anything you want, for example creature_killers.php import the code and save it. :)
 
Create a file in the home dir (same as other pages) and name the file anything you want, for example creature_killers.php import the code and save it. :)


I have a question again :p where in my page is the Most Creature Kills at? and is there anything else I need to do?

I use tfs 0.3 for 8.6

Thanks again!
 
Warning: Invalid argument supplied for foreach() inC:\xampp\htdocs\mosthunted.php on line 29

Using Znote AAC 1.5 with last TFS commit... 1.X

I need extra scripts? which ones for this ver.? i saw the other posts and those creaturescript doesn't work :(
 
Im using tfs 1.2 and i got this error Line 29 foreach($monterq as $q) {
Code:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\creatures.php on line 29
 
Im using tfs 1.2 and i got this error Line 29 foreach($monterq as $q) {
Code:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\creatures.php on line 29
@Dekon

If the line get this 29 th
Code:
foreach( $monterq as $q) {

change it to this worked for me
Code:
foreach((array) $monterq as $q) {

regards
 
I tried implementing this but nothing changes on the AAC
 
HalfAway

you could also put the files of TFS, I use 1.2, so you'll understand me, the count.lua of creaturescripts and what goes login.lua etc ..., I have made him what's on this link

https://otland.net/threads/gesior-a...-update-fixed-with-1-query.69920/#post-715971

but as you can see it is for Gęsior, and monsters will not tell me either the server or the acc.
Thanks in advance and greetings
If you're right, just get him out the images, but do not go neither dead nor palyers monsters for them. : /
Fixed -based search and look for everything OtLand; D
Well I finally works, you just have to enter the same as for the version Gęsior, minus the php file that has to be for Znote.
 
Back
Top