info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

@Vodkart , deu este erro ao logar com o player , tem como reparar pra min ?
[27/04/2013 17:54:24] [Error - CreatureScript Interface]
[27/04/2013 17:54:24] data/creaturescripts/scripts/login.lua:onLogin
[27/04/2013 17:54:24] Description:
[27/04/2013 17:54:24] data/lib/050-function.lua:3: attempt to call global 'getPlayerFrags' (a nil value)
[27/04/2013 17:54:24] stack traceback:
[27/04/2013 17:54:24] data/lib/050-function.lua:3: in function 'setFrags'
[27/04/2013 17:54:24] data/creaturescripts/scripts/login.lua:91: in function <data/creaturescripts/scripts/login.lua:5>
Editado Abril 27 por Tyrannoz
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

seu server não possui essa função...
vai em data > lib > 050-function.lua e adc:
function getPlayerFrags(cid)
local time = os.time()
local times = {today = (time - 86400), week = (time - (7 * 86400))}
local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
if(result:getID() ~= -1) then
repeat
local content = {date = result:getDataInt("date")}
if(content.date > times.today) then
table.insert(contents.day, content)
elseif(content.date > times.week) then
table.insert(contents.week, content)
else
table.insert(contents.month, content)
end
until not result:next()
result:free()
end
local size = {day = table.maxn(contents.day),week = table.maxn(contents.week),month = table.maxn(contents.month)}
return size.day + size.week + size.month
end
Editado Abril 27 por Vodkart
@Vodkart Funcionando perfeitamente, thanks! +REP
info
Grupo: Herói
Registrado: 25/10/12
Posts: 2.4k
Reputação: +687
Gênero: Masculino
Char no Tibia: Nuncative

Movido p/ pedidos e duvidas resolvidos.



info
Grupo: Campones
Registrado: 10/04/13
Posts: 28
Reputação: +7
Olá , boa tarde xtibianos ...
Vim pedir um script de rank de frags , o player usa !rankfrags e o rank de quem mais matou no ot, eu tinha pego um rank de frags só que quando eu uso o comando o ot fecha ... estou no aguardo.