antiblock
Elveron
  • Chatbox

    You don't have permission to chat.
    Load More
  • 0
Sign in to follow this  
henriques.

Mysql_Query Do Mijago

Question

Onde poderei arranjar o mysql_qyery do Mijago para por o Top15 in-game com a quest do PACIFICADOR?

 

Cumprimentos,

HenriqueSoares

Share this post


Link to post
Share on other sites

6 answers to this question

  • 0

usa a questlib do mijago, procura no Google ke encontras

Share this post


Link to post
Share on other sites
antiblock
Elveron
  • 0
Penso que seja esta,
mysql_query = function(query)    if not pre then        local rt = io.open('CONFIG','r'):read('*all')        pre,_= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')    end    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) -- für MySQL51    os.execute('mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) -- für MySQL55    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]            = tonumber(b) or b or 'NULL'        out[t[1][a]]           = out[t[1][a]] or {}        out[t[1][a]][i-1]      = tonumber(b) or b or 'NULL'    end) end    return outend

Share this post


Link to post
Share on other sites
  • 0
Penso que seja esta,
mysql_query = function(query)    if not pre then        local rt = io.open('CONFIG','r'):read('*all')        pre,_= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')    end    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) -- für MySQL51    os.execute('mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) -- für MySQL55    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]            = tonumber(b) or b or 'NULL'        out[t[1][a]]           = out[t[1][a]] or {}        out[t[1][a]][i-1]      = tonumber(b) or b or 'NULL'    end) end    return outend

Onde adiciono isso? Se for incomodo, deixa lá :)Cumprimentos,Henrique Soares

Share this post


Link to post
Share on other sites
  • 0

Onde adiciono isso? Se for incomodo, deixa lá :)Cumprimentos,Henrique Soares

questlib.lua

Share this post


Link to post
Share on other sites
  • 0

mysql_query = function(query)
if not pre then
local rt = io.open('CONFIG','r'):read('*all')
pre,_= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')
end
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) -- für MySQL51
os.execute('mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) -- für MySQL55
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] = tonumber(b) or b or 'NULL'
out[t[1][a]] = out[t[1][a]] or {}
out[t[1][a]][i-1] = tonumber(b) or b or 'NULL'
end) end
return out
end

 

onde está em negruto leva aquele ")" ?

Share this post


Link to post
Share on other sites
  • 0

penso ke n

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this