TheCh3HP 27 Posted August 3, 2016 Alguma alma caridosa de bom coração pode fazer-me uma quest (para um npc) que faça o ranking top 10 por kills? Para pessoas não inteligentes: Uma quest estilo o top 10 guilds, só que por kills! Share this post Link to post Share on other sites
LordKS 57 Posted August 3, 2016 Alguma alma caridosa de bom coração pode fazer-me uma quest (para um npc) que faça o ranking top 10 por kills? Para pessoas não inteligentes: Uma quest estilo o top 10 guilds, só que por kills! ##EDITED## quest pvp_ranking begin state start begin when kill with npc.is_pc() begin local kill_now = mysql_query("SELECT kills from player.player WHERE name='"..pc.get_name().."' LIMIT 1") local kill_up = mysql_query("UPDATE player.player SET kills ='"..(kill_now.kills[1]+1).."' WHERE name ='"..pc.get_name().."' LIMIT 1") end when 20093.chat."Raking PvP" begin say("Hello player here you can see the top pvp rankings") say("just select what you want to see:") say_reward("Select:") local sel = select("Global","Red Kingdom","Yellow Kingdom","Blue Kingdom","Back") local pp if sel == 5 then return elseif sel == 1 then pp = mysql_query("select name,kills from player.player ORDER BY kills desc,level desc,name asc LIMIT 15") else pp = mysql_query("select name,kills from player.player where (SELECT empire from player.player_index where player.account_id =id) = "..(sel-1).." ORDER BY kills desc,level desc,name asc LIMIT 15") end if pp == nil or (pp[1] or {})[1] == nil then say("Es gab einen Fehler.") return end say("Faild plese try to connect this quest with your database") table.foreachi(pp,function(i,l) say(i.." - "..l[1].." - "..l[2]) end) end end end No questlib.lua meter: mysql_query = function(query) local rt = io.open('CONFIG','r'):read('*all') local pre= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+) %s(%S+).+','-h%1 -u%2 -p%3 -D%4') math.randomseed(os.time()) local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2 ^10),{},{} os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi); for i = 2, table.getn(t) do table.foreach(t[i],function(a,b) out[i-1] = out[i-1] or {} out[i-1][a] = b out[t[1][a]] = out[t[1][a]] or {} out[t[1][a]][i-1] = b end) end return out end E nas functions: mysql_query Se ainda não a tiveres. Créditos: killerakiz1999g4 EPVPers Share this post Link to post Share on other sites
TheCh3HP 27 Posted August 3, 2016 http://cyber-gamers.org/topic/20508-quest-ranking-pvp-links-on-rancoroso/ Basta modificares um pouco a teu gosto. Cumprimentos. Isso diz a contagem dos teus kills. Acho que o rancoroso não sabe a definição de ranking. Share this post Link to post Share on other sites
LordKS 57 Posted August 3, 2016 Isso diz a contagem dos teus kills. Acho que o rancoroso não sabe a definição de ranking. Pois, dei copy paste para um notepad e vi o que realmente era xD Ja dei edit no post acima. Share this post Link to post Share on other sites
TheCh3HP 27 Posted August 3, 2016 Pois, dei copy paste para um notepad e vi o que realmente era xD Ja dei edit no post acima. Estava a ver esse tópico agora no elite xD Mas obrigado por ajudares >,< tens o meu +! Primeiro + que dou desde que entrei na aventura da cyber-gamers. Share this post Link to post Share on other sites