[Znote AAC] Most Creature Killers

Joined
Sep 3, 2011
Messages
3,636
Best answers
16
Likes
2,263
Location
Sweden
#1
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
 

Attachments

Last edited:
Joined
Sep 3, 2011
Messages
3,636
Best answers
16
Likes
2,263
Location
Sweden
#10
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. :)
 
Joined
Sep 11, 2008
Messages
344
Best answers
0
Likes
10
Location
Mexico - California
#11
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!
 
Joined
Oct 1, 2015
Messages
234
Best answers
0
Likes
26
Location
México
#12
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 :(
 

Dekon

Zerenia.net Owner
Joined
Feb 4, 2008
Messages
235
Best answers
0
Likes
2
Location
Sweden
#13
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
 
Joined
May 10, 2012
Messages
231
Best answers
0
Likes
10
Location
Barcelona
#14
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
 
Joined
May 10, 2012
Messages
231
Best answers
0
Likes
10
Location
Barcelona
#16
Joined
May 10, 2012
Messages
231
Best answers
0
Likes
10
Location
Barcelona
#19
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.
 
Top