[Admin] tierrilopes Posted July 8, 2019 at 08:29 PM Share Posted July 8, 2019 at 08:29 PM Link to comment Share on other sites More sharing options...
Anderson Fabris Posted July 9, 2019 at 05:10 PM Author Share Posted July 9, 2019 at 05:10 PM (edited) 20 horas atrás, tierrilopes disse: Tentei, e infelizmente não tive sucesso. ( Estava tudo certo ) ( Eu também estou com dificuldade no sistema de voucher, que também adicionaria na tabela. ) Alguém saberia me dizer o que estaria dando problema? Alguém teria uma solução pra adicionar a kill pela source? Edited July 9, 2019 at 05:10 PM by Anderson Fabris Link to comment Share on other sites More sharing options...
Anderson Fabris Posted July 10, 2019 at 04:11 AM Author Share Posted July 10, 2019 at 04:11 AM Poderia ser a versão do MYSQL? Estou usando a 5.6 no momento. Link to comment Share on other sites More sharing options...
[̲̅и̲̅є̲̅v̲̅є̲̅s̲̅] Posted August 18, 2019 at 08:12 PM Share Posted August 18, 2019 at 08:12 PM Adicione o seguinte código no final em questlib.lua Citar -- MySQL function string:split(delimiter) local result = {} local from = 1 local delim_from, delim_to = string.find(self, delimiter, from) while delim_from do table.insert(result, string.sub(self, from , delim_from-1)) from = delim_to + 1 delim_from, delim_to = string.find(self, delimiter, from) end table.insert(result, string.sub(self, from)) return result end function split(str, delim, maxNb) if str == nil then return str end if string.find(str, delim) == nil then return { str } end if maxNb == nil or maxNb < 1 then maxNb = 0 end local result = {} local pat = "(.-)" .. delim .. "()" local nb = 0 local lastPos for part, pos in string.gfind(str, pat) do nb = nb + 1 result[nb] = part lastPos = pos if nb == maxNb then break end end if nb ~= maxNb then result[nb + 1] = string.sub(str, lastPos) end return result end mysql_query = function(query) local version = 55 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),{},{} if version == 51 then os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi) elseif version == 55 then os.execute('mysql '..pre..' -e'..string.format('%q',query)..' > '..fi) else return 0 end 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,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 out.__lines = t[1] return out end --- Mysql END Depois tente usar essa quest. Citar https://mega.nz/#!NywA3S4a!9uepthhiimYS-dj95H2kJfczXC7XwXpZPTQNyXMf5uE Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now