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

[Gesior AAC] Most Creature Killers! [update! fixed with 1 query]

Is there anyway to make it so if someone with access 4-6 it don't show up on list?

Yes, easy.

Query:
PHP:
$qa = $SQL->query('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.' AND `players`.`group_id` < 4 ORDER BY ABS(value) DESC LIMIT '.$limit)->fetchAll();
 
Yes, easy.

Query:
PHP:
$qa = $SQL->query('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.' AND `players`.`group_id` < 4 ORDER BY ABS(value) DESC LIMIT '.$limit)->fetchAll();

Where i put this? :S

I can't do it -.-'
 
id of monsters

hello:confused:
can you tell me please, as they know the id of the monsters.
salu2;)
 
Zonet, can you help me? ._.

I dont need to put this in the Layouts or index.php? :S where i can find the 'page' if i dont put this.
Thanks
 
There is no id ... You have just to put storage and monster name.

Sorry, but I don't understand. What is storage ?
I've tried this code (put monster look types as "storage" and it didn't work). From where I should take this numbers?

Code:
$config['site']['creatureKills'] = array('dragon' => 9541,'Orshabaal' => 9549, 'Demodras' => 204, 'The Horned Fox' => 207, 'The Old Window' => 208, Ferumbras => 229);
 
[Lua, kill]
Lua:
  --[[ Script by slawkens, modified by Zonet]]--
local monsters = {
        ["dragon"] = 9541,
        ["orshabaal"] = 9549,
        ["demodras"] = 9554,
        ["the horned fox"] = 9555,
        ["the old widow"] = 9556,
	["ferumbras"] = 9557
}

function onKill(cid, target)
        if(isPlayer(target) ~= true and isPlayer(cid)) then
                local name = getCreatureName(target)
                local monster = monsters[string.lower(name)]
                if(monster) then
                        local killedMonsters = getPlayerStorageValue(cid, monster)
                        if(killedMonsters < 0) then
                                killedMonsters = 1
                        end
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
                        setPlayerStorageValue(cid, monster, killedMonsters + 1)
                end
        end
        return true
end

[PHP, config.php]
PHP:
$config['site']['creatureKills'] = array('dragon' => 9541,  'orshabaal' => 9549, 'demodras' => 9554, 'the horned fox' => 9555, 'the old widow' => 9556, 'ferumbras' => 9557);
 
Under
PHP:
switch($_REQUEST['subtopic']) {
Add
PHP:
 	case "creaturekills";
  	        $topic = "Creature Kills";
 	        $subtopic = "creaturekills";
 	        include("filename.php"); // your file name here .php
	break;
Now go to localhost/?subtopic=creaturekills
 
Is it possible to check instead of player which last killed monster guilds which have killed it ?

It would be better option for "ala RL open tibia servers" where people don't have 3000 lvl's and killing boss is adventure, not normal hunt.
 
In case you want to create the whole monster list, here you go:

PHP:
<?php
        $strg_num = 9541;

        if(file_exists($path = '/home/migxxx/tfs/data/monster/monsters.xml') && $xml = simplexml_load_file($path))
                foreach($xml as $xmlx)
                        echo('["'.strtolower($xmlx['name']).'"] = '.$strg_num++.',<br />');
?>

Where do i paste this???
 
Back
Top