Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''top''.



Mais opções de pesquisa

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • A Cidade OTBR
    • OTServ Brasil
    • Atendimento
    • Taverna
  • Projetos Open Source
    • Canary
    • OTServBR-Global
    • Mehah OTClient
    • MyAAC
  • OpenTibia
    • Notícias e Discussões
    • Suporte - Dúvidas, Bugs, Erros
    • Downloads
    • Tutoriais
    • Show-Off
  • Outros
    • Design

Encontrado 2 registros

  1. Top 25 Fraggers

    Top 25 Fraggers no Site O Script.lua Basicamente este script mostra no Site um Rank dos jogadores que mais matam outros Jogadores, a cada jogador Morto é adicionado um valor no banco de dados fazendo a contagen de quantos jogadores cada jogador matou e ele vai ganhando caveirinhas.:yes: Screen Shot Vamos Começar a Parte Mysql e PHP: Vá no seu banco de dados em mysql, e execute no banco de dados do seu OT este comando Mysql: ALTER TABLE `players` ADD `frags_all` INT( 11 ) NOT NULL; Agora vamos criar a Pagina do Site em PHP, vá na pasta do seu site, se voce usar xampp vá em c:/xampp/htdocs copie um arquivo PHP e cole na mesma pasta e renomei-o para frags.php e adicione este código la dentro: <?php function coloured_value($valuein) { $value2 = $valuein; while(strlen($value2) > 3) { $value .= ' '.substr($value2, -3, 3); $value2 = substr($value2, 0, strlen($value2)-3); } $value = $value2.$value; if($valuein > 0) return ''.$value.''; elseif($valuein < 0) return '<font color="red">-'.$value.'</font>'; else return ''.$value.''; } function placeImages($count){ if($count > 300) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'>"; if($count > 260) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'>"; if($count > 230) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>"; if($count > 190) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'>"; if($count > 150) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>"; if($count > 120) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'>"; if($count > 90) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>"; if($count > 70) return "<img src='images/redskull.gif'><img src='images/redskull.gif'>"; if($count > 50) return "<img src='images/redskull.gif'><img src='images/redskullhalf.gif'>"; if($count > 30) return "<img src='images/redskull.gif'>"; if($count > 10) return "<img src='images/redskullhalf.gif'>"; } function showTopExp() { global $SQL; global $config,$connect; $world = $_GET['world']; if ($world > 0 && is_numeric($world)){ $world = " WHERE `world_id` = ".(int)($world-1).""; } $return .= "<br><h2><center><font color='red'>Top 25 Fragers on ".$config['server']['serverName']."</font></center></h2><br> <table border=0 cellspacing=1 cellpadding=4 width=100%> <tr bgcolor=\"".$config['site']['vdarkborder']."\"> <td class=white><font><b>Lp.</b></font></td> <td class=white width=\"40%\"><font><b>Name</b></font></td> <td class=white><font><b>Online</b></font></td> <td class=white width=\"20%\"><font><b>World</b></font></td> <td class=white width=\"40%\"><font><b>Count</b></font></td></tr>"; $groupMembers = $SQL->query('SELECT `name`,`frags_all`,`level`,`world_id`,`online`,`account_id` FROM `players`'.$world.' ORDER BY `frags_all` DESC LIMIT 25'); $membersCount = 0; $memberss = 0; foreach($groupMembers as $member) { $membersCount++; if(is_int($membersCount / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder']; $count = $member['experience']-$member['exphist_lastexp']; $return .= "<tr bgcolor=\"".$bgcolor."\"><td>".$membersCount.".</td> <td><a href=\"index.php?subtopic=characters&name=".$member['name']."\">".$member['name']." [".$member['level']."]</a></td> <td><center>".$on."</center></td> <td>".$config['server']['serverName']."</td> <td>".$member['frags_all']." different people<br/>".placeImages($member['frags_all'])."</td> </tr>"; $memberss++; } if ($membersCount = 0) $return .= "<tr bgcolor=\"".$config['site']['darkborder']."\"> <td colspan=\"2\">No statistics available.</td> </tr>"; $return .= "</table>"; if($memberss > 0){ $memberss = 0; return $return; }else { return false; } } $main_content .= showTopExp(); ?> Salve, e abra o index.php e abaixo disto: Adicione Isto: Salve e vá na pasta Layouts/tibiacom/layout.php e abra como bloco de notas ou arquivo wordpad, e abaixo disto: Adicione isto: Salve e Pronto, a parte do Site esta terminada se kiser testar é só digitar: http://localhost/index.php?subtopic=frags Agora Vamos iniciar a Parte dos Scripts Abra a pasta data/creaturescripts/scripts do seu OT, copie qualquer arquivo la dentro e renomei-o de frags.lua e adicione isto: function onKill(cid, target, lastHit) if(isPlayer(target) ~= true) then return true end if (isPlayer(cid) == true) and (isPlayer(target) == true) then if getPlayerSkullType(target) == SKULL_WHITE then addPlayerFrag(cid, 1) elseif getPlayerSkullType(target) == SKULL_YELLOW then addPlayerFrag(cid, 1) elseif getPlayerSkullType(target) == SKULL_RED then addPlayerFrag(cid, 1) elseif getPlayerSkullType(target) == SKULL_BLACK then addPlayerFrag(cid, 1) elseif getPlayerSkullType(target) == SKULL_NONE then addPlayerFrag(cid, 1) end return TRUE end end Na mesma pasta abra seu Login.lua e adicione isso: registerCreatureEvent(cid, "Frags") em creaturescripts.xml adicione: <event type="kill" name="Frags" event="script" value="frags.lua" /> Agora va na pasta data/lib e abra o seu function.lua e depois do ultimo end, adicione: function addPlayerFrag(cid, amount) db.executeQuery("UPDATE `players` SET `frags_all` = `frags_all` + " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";") end Salve, Abra seu OT e Teste!(Y) [spoiler=Créditos]50% Skeyba(Mysql e PHP) e 50% Dreamer(Script)
  2. Top 25 Fraggers

    Seguinte pessoal, uma coisa bem interessante, é um script que conta qtos players voce matou. e o rank aparece no site. e tipo, eu tenhu a parte em PHP, e a tabela que inseri no banco de dados Mysql, so ta faltando o script que conta e executa isso no banco. Creio que seria um Creaturescript que faz +/- isso que vou postar aqui, claro que ta tudo errado é só pra terem uma noção sei la OAskoaskkao: Script meia boca : function onKill(cid, target, lasthit) if(isPlayer(target) == TRUE) then local lashit = getCreatureName(cid) local killedPlayers = getPlayerStorageValue(cid, 23112) if(killedPlayers == -1) then killedPlayers = 1 end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você matou " .. killedPlayers .."Players.") setPlayerStorageValue(cid, lashit, killedPlayers + 1) db.executeQuery("INSERT INTO players (`frags_all`) VALUES\n('".. killedPlayers.."');") end end return TRUE end OBS: Nao faço a menor ideia se este script funciona, Por favor HELP!! Ta ai a Screen Shot: conforme vai matando mto player as cavera red skull vai aumentando... quero ajudar nao só a mim, mas creio que este sistema seja UTIL para muita gente que sempre quis algo assim, vou disponibilizar abaixo o MYSQL e o PHP... MYSQL: ALTER TABLE `players` ADD `frags_all` INT( 11 ) NOT NULL; frags.php <?php function coloured_value($valuein) { $value2 = $valuein; while(strlen($value2) > 3) { $value .= ' '.substr($value2, -3, 3); $value2 = substr($value2, 0, strlen($value2)-3); } $value = $value2.$value; if($valuein > 0) return ''.$value.''; elseif($valuein < 0) return '<font color="red">-'.$value.'</font>'; else return ''.$value.''; } function placeImages($count){ if($count > 300) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'>"; if($count > 260) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/blackskull.gif'><img src='images/blackskull.gif'>"; if($count > 230) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>"; if($count > 190) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'>"; if($count > 150) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>"; if($count > 120) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskull.gif'>"; if($count > 90) return "<img src='images/redskull.gif'><img src='images/redskull.gif'><img src='images/redskullhalf.gif'>"; if($count > 70) return "<img src='images/redskull.gif'><img src='images/redskull.gif'>"; if($count > 50) return "<img src='images/redskull.gif'><img src='images/redskullhalf.gif'>"; if($count > 30) return "<img src='images/redskull.gif'>"; if($count > 10) return "<img src='images/redskullhalf.gif'>"; } function showTopExp() { global $SQL; global $config,$connect; $world = $_GET['world']; if ($world > 0 && is_numeric($world)){ $world = " WHERE `world_id` = ".(int)($world-1).""; } $return .= "<br><h2><center><font color='red'>Top 25 Fragers on ".$config['server']['serverName']."</font></center></h2><br> <table border=0 cellspacing=1 cellpadding=4 width=100%> <tr bgcolor=\"".$config['site']['vdarkborder']."\"> <td class=white><font><b>Lp.</b></font></td> <td class=white width=\"40%\"><font><b>Name</b></font></td> <td class=white><font><b>Online</b></font></td> <td class=white width=\"20%\"><font><b>World</b></font></td> <td class=white width=\"40%\"><font><b>Count</b></font></td></tr>"; $groupMembers = $SQL->query('SELECT `name`,`frags_all`,`level`,`world_id`,`online`,`account_id` FROM `players`'.$world.' ORDER BY `frags_all` DESC LIMIT 25'); $membersCount = 0; $memberss = 0; foreach($groupMembers as $member) { $membersCount++; if(is_int($membersCount / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder']; $count = $member['experience']-$member['exphist_lastexp']; $return .= "<tr bgcolor=\"".$bgcolor."\"><td>".$membersCount.".</td> <td><a href=\"index.php?subtopic=characters&name=".$member['name']."\">".$member['name']." [".$member['level']."]</a></td> <td><center>".$on."</center></td> <td>".$config['server']['serverName']."</td> <td>".$member['frags_all']." different people<br/>".placeImages($member['frags_all'])."</td> </tr>"; $memberss++; } if ($membersCount = 0) $return .= "<tr bgcolor=\"".$config['site']['darkborder']."\"> <td colspan=\"2\">No statistics available.</td> </tr>"; $return .= "</table>"; if($memberss > 0){ $memberss = 0; return $return; }else { return false; } } $main_content .= showTopExp(); ?> Preciso com Urgencia...
×