Ir para conteúdo

[Gesior Aac] Real Kill Statistics (Monsters).


tyuahoi

Posts Recomendados

Olá

 

 

Script para Quem Quiser Deixar Seu Site Com O Kill Statistics Igual O Da CipSoft.

 

Va Em:

C:\xampp\htdocs

 

Faça Um Novo Arquivo Com O Nome: Kill.lua

 

E Cole Isso:

 <?PHP
//CONFIG
$mysql_user = "root";
$mysql_pass = "sexyloves2";
$mysql_database = "sexylove";
$mysql_host = "localhost";
//END OF CONFIG


$numberlist = 0;
$timenow = time();
$dayago = $timenow - 86400;
$weekago = $timenow - (86400 * 7);

mysql_connect($mysql_host,$mysql_user,$mysql_pass) or die ("Could not connect to a MySQL server");
mysql_select_db($mysql_database);
$deaths_data = mysql_query('SELECT name FROM environment_killers;');
$data1 = mysql_fetch_assoc($deaths_data);
$x = 100;
$x1 = $x/6;
$x2 = $x/3;
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'> <TD CLASS=red width="'.$x2.'%"></TD><TD CLASS=red width="'.$x2.'%" colspan=2><B><font color="'.$config['site']['lightborder'].'">Last Day</B></TD><TD CLASS=red width="'.$x2.'%" colspan=2><B><font color="'.$config['site']['lightborder'].'">This Week</B></TD></TR>';
$main_content .= '<TR BGCOLOR='.$config['site']['vdarkborder'].'> <TD><B><font color="'.$config['site']['lightborder'].'">Race</B></TD><TD><B><font color="'.$config['site']['lightborder'].'">Killed Players</B></TD><TD><B><font color="'.$config['site']['lightborder'].'">Killed by Players</B></TD><TD><B><font color="'.$config['site']['lightborder'].'">Killed Players</B></TD><TD><B><font color="'.$config['site']['lightborder'].'">Killed by Players</B></TD></TR>';
$delete_old = $SQL->query('SELECT * FROM killed_monsters where date < '.$weekago.';');
if(!empty($delete_old))
{
   foreach($delete_old as $del)
   {
   $old = $del['date'];
   if ($old < $weekago)
   {
   mysql_query('DELETE FROM `killed_monsters` WHERE id = '.$del['id'].';');
   }
   }
}

if(!empty($deaths_data))
$available_monsters = $SQL->query('SELECT name FROM z_monsters GROUP by name;');
{

   foreach($available_monsters as $monstrums)
   {

   /* Killed Players By Monsters  Daily */
   $killers_monsters = mysql_query('SELECT COUNT(name) as liczba FROM environment_killers,player_deaths,killers where player_deaths.id = killers.death_id and killers.id = environment_killers.kill_id and name LIKE "%'.$monstrums[name].'" and date > '.$dayago.';');
   $count1 = mysql_fetch_assoc($killers_monsters);
   $count = $count1['liczba'];

   /* Killed Players By Monsters Weekly */
   $killers_monsters1 = mysql_query('SELECT COUNT(name) as liczba FROM environment_killers,player_deaths,killers where player_deaths.id = killers.death_id and killers.id = environment_killers.kill_id and name LIKE "%'.$monstrums[name].'" and date > '.$weekago.';');
   $count3 = mysql_fetch_assoc($killers_monsters1);
   $count2 = $count3['liczba'];

   /* Killed Monsters By Players Weekly */
   $player_killers = mysql_query('SELECT COUNT(name) as liczba FROM killed_monsters where name LIKE "%'.$monstrums[name].'" and date > '.$weekago.';');
   $count5 = mysql_fetch_assoc($player_killers);
   $count4 = $count5['liczba'];

   /* Killed Monsters By Players Daily */
   $player_killers1 = mysql_query('SELECT COUNT(name) as liczba FROM killed_monsters where name LIKE "%'.$monstrums[name].'" and date > '.$dayago.';');
   $count7 = mysql_fetch_assoc($player_killers1);
   $count6 = $count7['liczba'];

   $displayday_kp = 0;
   $displayweek_kp = 0;
   $displayday_pk = 0;
   $displayweek_pk = 0;

   if ($count == 0)
   {
   $displayday_kp = 0;
   }
   else
   {
   $displayday_kp = 1;
   }

   if ($count2 == 0)
   {
   $displayweek_kp = 0;
   }
   else
   {
   $displayweek_kp = 1;
   }

   if ($count4 == 0)
   {
   $displayweek_pk = 0;
   }
   else
   {
   $displayweek_pk = 1;
   }

   if ($count6 == 0)
   {
   $displayday_pk = 0;
   }
   else
   {
   $displayday_pk = 1;
   }
   if (($displayday_kp == 1) or ($displayweek_kp == 1) or ($displayweek_pk == 1) or ($displayday_pk == 1))
   {
       if(!empty($killers_monsters))
       {
       $numberlist++;
       if(is_int($numberlist / 2))
       {
           $bgcolor = $config['site']['darkborder'];
       }
       else
       {
           $bgcolor = $config['site']['lightborder'];
       }
       // By QuaS~
       $main_content .= '<TR BGCOLOR='.$bgcolor.'> <TD><B><font CLASS = "red">'.$monstrums[name].'</B></TD><TD><B><font CLASS = "red">'.$count.'</B></TD><TD><B><font CLASS = "red">'.$count6.'</B></TD><TD><B><font CLASS = "red">'.$count2.'</B></TD><TD><B><font CLASS = "red">'.$count4.'</B></TD></TR>';

       }
   }        

       }
       }

$main_content .= '</TABLE>';
?> 

 

Configure Corretamente Estas Linhas:

 

//CONFIG
$mysql_user = "user";
$mysql_pass = "password";
$mysql_database = "database";
$mysql_host = "localhost";
//END OF CONFIG  

 

Agora Va Em:

/data/creatureevents/scripts

 

Faça Um NOvo arquivo Com o Nome:

counter.lua

 

e Cole Isso:

 

  function onKill(cid, target, lastHit)
local monster = getCreatureName(target)
if isMonster(target) == TRUE then
       db.executeQuery("INSERT INTO killed_monsters (`name`, `date`) VALUES\n('".. monster .."',".. os.time() ..");")

       end
       return TRUE
end 

 

Abra o: Login.lua

 

E adicione Isso:

registerCreatureEvent(cid, "Counter")

 

 

Agora Abra O: creatureevents.xml

 

E adicione Isso:

<event type="kill" name="Counter" script="counter.lua"/>

 

 

Abra Seu Detabase e adicione isso:

 

CREATE TABLE killed_monsters 
(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
date BIGINT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE = InnoDB  

 

 

 

Agora Va Em Index E adicione Isso:

 

	case "KillStatistic";
	$topic = "Kill Statistic";
	$subtopic = "Kills";
	include("kill.php");
break;	

 

agora va em: C:\xampp\htdocs\layouts\tibiacom

 

Abra O Layout.php

 

e adicione logo abaixo de:

 

<a href='?subtopic=killstatistics'>
 <div id='submenu_killstatistics' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
   <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
   <div id='ActiveSubmenuItemIcon_killstatistics' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>
   <div class='SubmenuitemLabel'>Last Kills</div>
   <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
 </div>
</a>

 

adicione Isso::

 

<a href='index.php?subtopic=killstatistic'>
 <div id='submenu_wars' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
   <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
   <div id='ActiveSubmenuItemIcon_killstatistic' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>
   <div class='SubmenuitemLabel'><font color="white">Kill Statistic</font></div>
   <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
 </div>
</a>

 

 

Pronto.

 

 

Bom Uso.

Editado por 1tyi
Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...
  • 1 month later...
  • 3 months later...

Por favor onde fica esse > creatureevents ??? no meu só tem global events e creaturescripts

 

e outra coloque ino creature scripts as coisas e na hora da isso >> Invalid subtopic. Can't load page.

 

 

 

 

Grato aguardo resposta!

 

OOObrigado!

Link para o comentário
Compartilhar em outros sites

Cara, o tópico está com um mês ou mais sem respostas então você renasceu o tópico e isto é contra as regras do XTibia.

Reportado para fecharem;

Abraços.

Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...

Invalid subtopic. Can't load page. ,ja refiz oque vc mandou 5x e sempre da isso creio que tenha um erro vc manda criar 1 arquivo chamado kill.lua mas na vdd seria kill.php tentei dos 2 geitos é nao deu arruma ai !

Link para o comentário
Compartilhar em outros sites

  • 2 years later...

Quem não está conseguindo pq retorna o erro "cant load page" basta ir em C:\xampp\htdocs\ e abrir o index.php e depois de:

case "changelog";
  $topic = "Changelog";
 $subtopic = "changelog";
 include("changelog.php");
break;

 

adicione isso:

case "killstatistics";
  $topic = "Kill Statistic";
 $subtopic = "killstatistics";
 include("killstatistics.php");
break;

 

E a primeira parte do tópico está errada. Em vez de você criar o "kill.LUA", crie o killstatistics.PHP

Testem e corrijam-me caso eu esteja errado!

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...