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

Modern AAC Page - Most Creature Killers!

cant get this to work with the latest MAAC, its a problem with the config/connect code. If this section is there the page wont load ANYTHING.
The ingame scripting is working fine and displaying that kill counts ect.

require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();

And if that is taken out then it loads the echoes ect.
 
I found out that the monsters storagevalue is -1 when killing, then it will be 0. So when you kill your first demon or something, it shows that you have killed 0. So i made that, when the players makes their character, on firstitem.xml then it will give the player the storages...

Firstitem.xml - MOD:
[MOD]<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
<config name="firstitems_config"><![CDATA[
config = {
storage = 30001,
storagee = 9541,
storageee = 9542,
storageeee = 9543,
storageeeee = 9544,
storageeeeee = 9545,
items = {2050, 2382}
}
]]></config>
<event type="login" name="FirstItems" event="script"> <![CDATA[
domodlib('firstitems_config')

function onLogin(cid)
local config = {
voc_items = {
{ -- SORC
{2173}, -- amulet of loss
{2190}, -- wand of vortex
{2175}, -- spellbook
{8820}, -- mage hat
{8819} -- mage robe
},
{ -- DRUID
{2173}, -- amulet of loss
{2182}, -- snakebite rod
{2175}, -- spellbook
{8820}, -- mage hat
{8819} -- mage robe
},
{ -- PALADIN
{2173}, -- amulet of loss
{2389}, -- spear
{2530}, -- copper shield
{2480}, -- legion helmet
{2464} -- chain armor
},
{ -- KNIGHT
{2173}, -- amulet of loss
{2383}, -- spike sword
{2530}, -- copper shield
{2480}, -- legion helmet
{2464} -- chain armor
}
},
all_items = {
{2468}, -- studded legs
{2643} -- leather boots
},
extra_items = {
{2789, 15},
{2120},
{5710}
},
knight_weapons = {
{2423}, -- clerical mace
{2429} -- barbarian axe
}
}
if getPlayerGroupId(cid) < 3 then
if getPlayerStorageValue(cid, storage) == -1 and getPlayerStorageValue(cid, storagee) == -1 and getPlayerStorageValue(cid, storageee) == -1 and getPlayerStorageValue(cid, storageeee) == -1 and getPlayerStorageValue(cid, storageeeee) == -1 and getPlayerStorageValue(cid, storageeeeee) == -1 then
local common = config.voc_items[getPlayerVocation(cid)]
if common ~= nil then
for _, v in ipairs(common) do
doPlayerAddItem(cid, v[1], v[2] or 1)
end
end

local all = config.all_items
if all ~= nil then
for _, v in ipairs(all) do
doPlayerAddItem(cid, v[1], v[2] or 1)
end
end

local extra = config.extra_items
local bp = doPlayerAddItem(cid, 1988, 1)
if extra ~= nil then
for _, v in ipairs(extra) do
doAddContainerItem(bp, v[1], v[2] or 1)
end
end

local weapons = config.knight_weapons
if weapons ~= nil then
for _, w in ipairs(weapons) do
if isKnight(cid) then
doAddContainerItem(bp, w[1], w[2] or 1)
end
end
end

setPlayerStorageValue(cid, storage, 1)
setPlayerStorageValue(cid, storagee, 0)
setPlayerStorageValue(cid, storageee, 0)
setPlayerStorageValue(cid, storageeee, 0)
setPlayerStorageValue(cid, storageeeee, 0)
setPlayerStorageValue(cid, storageeeeee, 0)
end
end
return true
end
]]></event>
</mod>[/MOD]
 
Sorry for double posting, could'nt edit the post above:

XML:
 <?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 30001,
			storagee = 9541,
			storageee = 9542,
			storageeee = 9543,
			storageeeee = 9544,
			storageeeeee = 9545,
			items = {2050, 2382}
		}
	]]></config>
	<event type="login" name="FirstItems" event="script"> <![CDATA[
		domodlib('firstitems_config')
 
		function onLogin(cid)
	local config = {
		voc_items = {
			{ -- SORC
				{2173}, -- amulet of loss
				{2190}, -- wand of vortex
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819} -- mage robe
			},
			{ -- DRUID
				{2173}, -- amulet of loss
				{2182}, -- snakebite rod
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819} -- mage robe
			},
			{ -- PALADIN
				{2173}, -- amulet of loss
				{2389}, -- spear
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			},
			{ -- KNIGHT
				{2173}, -- amulet of loss
				{2383}, -- spike sword
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			}
		},
		all_items = {
			{2468}, -- studded legs
			{2643} -- leather boots
		},
		extra_items = {
			{2789, 15},
			{2120},
			{5710}
		},
		knight_weapons = {
			{2423}, -- clerical mace
			{2429} -- barbarian axe
		}
	}
	if getPlayerGroupId(cid) < 3 then
		if getPlayerStorageValue(cid, storage) == -1 and getPlayerStorageValue(cid, storagee) == -1 and getPlayerStorageValue(cid, storageee) == -1 and getPlayerStorageValue(cid, storageeee) == -1 and getPlayerStorageValue(cid, storageeeee) == -1 and getPlayerStorageValue(cid, storageeeeee) == -1 then
			local common = config.voc_items[getPlayerVocation(cid)]
			if common ~= nil then
				for _, v in ipairs(common) do
					doPlayerAddItem(cid, v[1], v[2] or 1)
				end
			end
 
			local all = config.all_items
			if all ~= nil then
				for _, v in ipairs(all) do
					doPlayerAddItem(cid, v[1], v[2] or 1)
				end
			end
 
			local extra = config.extra_items
			local bp = doPlayerAddItem(cid, 1988, 1)
			if extra ~= nil then
				for _, v in ipairs(extra) do
					doAddContainerItem(bp, v[1], v[2] or 1)
				end
			end
 
			local weapons = config.knight_weapons
			if weapons ~= nil then
				for _, w in ipairs(weapons) do
					if isKnight(cid) then
						doAddContainerItem(bp, w[1], w[2] or 1)
					end
				end
			end
 
			setPlayerStorageValue(cid, storage, 1)
			setPlayerStorageValue(cid, storagee, 0)
			setPlayerStorageValue(cid, storageee, 0)
			setPlayerStorageValue(cid, storageeee, 0)
			setPlayerStorageValue(cid, storageeeee, 0)
			setPlayerStorageValue(cid, storageeeeee, 0)
		end
	end
	return true
end
	]]></event>
</mod>
 
/* Kill configuration */
$kills = array('rat' => 3001, 'cave rat' => 3002, 'troll' => 3003, 'wyrm' => 9544, 'demon' => 9545);
$limit= 5;

how i can add more monstres to page where i found these storage values?
 
Page won't load for me. My PHP page
PHP:
<?PHP


/* Scrip by zonet */
/* Modern Aac version by Kavvson */
/* Kill configuration */
$kills = array('dragon' => 9541, 'dragon lord' => 9542, 'frost dragon' => 9543, 'wyrm' => 9544, 'demon' => 9545, 'rotworm' => 9546, 'vampire' => 9547, 'draken elite' => 9548, 'draken abomination' => 9549, 'draken warmaster' => 9550, 'nightmare' => 9551, 'nightmare scion' => 9552, 'grim reaper' => 9553, 'juggernaut' => 9554, 'behemoth' => 9555, 'hellhound' => 9556, 'hero' => 9557, 'warlock' => 9558, 'lich' => 9559, 'dark torturer' => 9560, 'diabolic imp' => 9561, 'destroyer' => 9562, 'hand of cursed fate' => 9563, 'plaguesmith' => 9564, 'undead dragon' => 9565, 'ghastly dragon' => 9566, 'bog raider' => 9567, 'draken spellweaver' => 9568, 'lizard chosen' => 9569, 'lizard dragon priest' => 9570, 'lizard high guard' => 9571, 'lizard legionnaire' => 9572, 'lizard sentinel' => 9573, 'lizard snakecharmer' => 9574, 'lizard templar' => 9575, 'lizard zaogun' => 9576, 'lizard magistratus' => 9577, 'lizard noble' => 9578, 'banshee' => 9579, 'spectre' => 9580, 'blightwalker' => 9581, 'quara constrictor' => 9582, 'quara hydromancer' => 9583, 'quara mantassin' => 9584, 'quara pincher' => 9585, 'quara predator' => 9586, 'black knight' => 9587 'phantasm' => 9588);
$limit= 5;
/* Color config */
$color1 = "#a46f00" ;

ECHO '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
            <tr bgcolor="'.$color1.'" style="color: white;"><th width="10%">Creature</th><th>Creature name</th><th>Most Killer ( '.$limit.' )</th></tr>';
$row = 1;
    foreach($kills as $name => $storage) {
    $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.' ORDER BY ABS(value) DESC LIMIT '.$limit)->fetchAll();
  /* Color config */
  $color = ( $row % 2 ? "#e5cc97" : "#eeddb9" );
   $row++;
    ECHO '<tr bgcolor="'.$color.'"><td><img src="/monsters/'.(str_replace("></td><td width="20%" style="font-size: 13pt; font-weight: bold; color: darkorange;"><center>'.(ucfirst($name)).'</center></td><br /><td>';
        $a = 0;
        foreach( $qa 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="'.WEBSITE.'/index.php/character/view/'.$q['name'].'">'.$q['nam<br />e'].'</a> (Kills:  '.$q['value'].') </font></font></font><br />';
        }
    }
    ECHO '</td></table>';
?>
 
It already works good with Modern AAC?
 
@up, replace line 24 with this
PHP:
echo('<tr bgcolor="'.$color.'"><td><img src="/monsters/'.(str_replace(" ", "" , $name)).'.gif"></td><td width="20%" style="font-size: 13pt; font-weight: bold; color: darkorange;"><center>'.(ucfirst($name)).'</center></td><td>');

and make sure you have the monster folder.

Where is the "main" folder? Is it system/pages/monster/ or what?
 
Back
Top