Hello i create Guild War System or/and Tournament System. I test in TFS 0.4 no crashes.
Commands :
!guilds guildfirstname1,guildsecondname,arena -- start war
--
!reset only for admins -- reset storage
--
Teleport for join guild to war actionid 9990 -- CREATE IN TEMPLE
Teleport for leave wait room : for first room actionid 6467 for second actionid 6468 -- CREATE IN WAIT ROOMS
In arena create no logout, in wait room no logout and pz!
DB:
Acc :
MOD :
SCAN:
Commands :
!guilds guildfirstname1,guildsecondname,arena -- start war
--
!reset only for admins -- reset storage
--
Teleport for join guild to war actionid 9990 -- CREATE IN TEMPLE
Teleport for leave wait room : for first room actionid 6467 for second actionid 6468 -- CREATE IN WAIT ROOMS
In arena create no logout, in wait room no logout and pz!
DB:
HTML:
CREATE TABLE `guildwar_system` (
`id` int(11) NOT NULL auto_increment,
`guild_win` int(11),
`guild_lose` int(11),
`win_frags` int(11),
`lose_frags` int(11),
`war_date` int(11),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Acc :
PHP:
<?php
$main_content = "<h1 align=\"center\">TOURNAMENT STATS</h1>
<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">
<tr>
<td style=\"background: " . $config['site']['vdarkborder'] . "\" class=\"white\" width=\"150\"><center><b>Winners</b></center></td>
<td style=\"background: " . $config['site']['vdarkborder'] . "\" class=\"white\"><center><b>Information</b></center></td>
<td style=\"background: " . $config['site']['vdarkborder'] . "\" class=\"white\" width=\"150\"><center><b>Losers</b></center></td>
</tr>";
$count = 0;
foreach($SQL->query('SELECT * FROM `guildwar_system`;') as $war){
$a = $ots->createObject('Guild');
$a->load($war['guild_win']);
if(!$a->isLoaded())
continue;
$e = $ots->createObject('Guild');
$e->load($war['guild_lose']);
if(!$e->isLoaded())
continue;
$alogo = $a->getCustomField('logo_gfx_name');
if(empty($alogo) || !file_exists('guilds/' . $alogo))
$alogo = 'default_logo.gif';
$elogo = $e->getCustomField('logo_gfx_name');
if(empty($elogo) || !file_exists('guilds/' . $elogo))
$elogo = 'default_logo.gif';
$count++;
$main_content .= "<tr style=\"background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\">
<td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$a->getId()."\"><img src=\"guilds/".$alogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$a->getName()."</a></td>
<td class=\"white\" align=\"center\">";
switch($war['status'])
{
case 0:
{
$main_content .= "<font size=\"12\"><span style=\"color: blue;\">" . $war['win_frags'] . "</span> : <span style=\"color: green;\">" . $war['lose_frags'] . "</span></font><br /><br /><br />End on " . date("M d Y, H:i:s", $war['war_date']) ."" ;
break;
}
default:
{
$main_content .= "Unknown, please contact with gamemaster.";
break;
}
}
$main_content .= "
<td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$e->getId()."\"><img src=\"guilds/".$elogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$e->getName()."</a></td>
</tr>
<tr id=\"war-details:" . $war['id'] . "\" style=\"display: none; background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\">
<td colspan=\"3\">";
$main_content .= "</td>
</tr>";
}
if($count == 0)
$main_content .= "<tr style=\"background: ".$config['site']['darkborder'].";\">
<td colspan=\"3\">Currently there are no active wars.</td>
</tr>";
$main_content .= "</table>";
?>
HTML:
http://www.sendspace.com/file/wpzp51
Code:
https://www.virustotal.com/pl/file/414d3039d2e998e78f936942de47231be5c9ae0e19c8538ad6a18ebf720bbf7d/analysis/1389567156/
Last edited: