Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

Rev. 3777 TFS 0.4 8.60

Qual o motivo deste tópico? 

Galera, preciso de um "pedido/suporte" para criar um RANK TOP 5. onde os 5 players com mais torneio ganha tal titulo. e imprima esse titulo no Look.
no site modern aac eu tenho esse ranking. Agr preciso por in game.
 

Spoiler


Você tem o código disponível? Se tiver publique-o aqui: 


 <?PHP 
//** Connection to the database **// 
$ots = POT::getInstance(); 
$ots->connect(POT::DB_MYSQL, connection()); 
$SQL = POT::getInstance()->getDBHandle(); 

							echo '
<table border="0" cellspacing="1" cellpadding="1" width="100%"> 
 <tr> 
  <th class="black" style="text-align: left; font-weight: bold;">#</td> 
  <th class="black" style="text-align: left; font-weight: bold;">&nbsp;Name</td> 
  <th class="black" style="text-align: center; font-weight: bold;">Torneios</td> 
 </tr>'; 
 
                                $money_list = $SQL->query('SELECT name,torneio FROM players ORDER BY torneio DESC LIMIT 5')->fetchAll(); 
                                        $i = 0; 
                                        foreach($money_list as $money_chr){ 
										
                                        echo '<center>'; 
										{ 
										 $i++; 
										echo '<tr class="highlight">
  <td>'.$i.'.</td> 
  <td>
	<font size="1" color="red"> <strong>&nbsp;<a href="'.WEBSITE.'/index.php/character/view/'.$money_chr['name'].'">' . $money_chr['name'] . '</strong></font></a></td> 
  <td>
  <center><strong>' .$money_chr['torneio'] . '</strong></center></td> 
 </tr>'; 
} 																																																																						
}  
echo '</table>'; 

	?>


 

começo do codigo de rank in game:
 

Spoiler

function getTorneio(cid)
   local query, z = db.getResult("SELECT `player_id` FROM `player_torneio` WHERE `player_id` = " ..getPlayerGUID(cid)), 0
   if (query:getID() ~= -1) then
      repeat
         z = z+1
      until not query:next()
      query:free()
   end
   return z  
end

function GetRankTorneio(cid)
	local ranks_torneio = {
		[{rank 5}] = "Makaiohs", 
		[{rank 4}] = "Kaioshins",
		[{rank 3}] = "Makaioshins",
		[{rank 2}] = "Kaioshin Shinsei",		
		[{rank 1}] = "Hakaishin"
	}



function onLook(cid, thing, position, lookDistance)
   if isPlayer(thing.uid) and getRankTorneio(thing.uid) > -1 then
      return doPlayerSetSpecialDescription(thing.uid, '\n'.. '[' .. GetRankTorneio(thing.uid) ..']')
   elseif thing.uid == cid then     
      local string = 'You see yourself.'
      if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
         string = string..' You are '.. getPlayerGroupName(cid) ..'.'
      elseif getPlayerVocation(cid) ~= 0 then
         string = string..' You are '.. getPlayerVocationName(cid) ..'.'
      else
         string = string..' You have no vocation.'
      end

 


 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.1k

Informação Importante

Confirmação de Termo