Jump to content
  • 0

Tyrannoz

Question

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.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

@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>

Edited by Tyrannoz
Link to comment
Share on other sites

  • 0

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

Edited by Vodkart
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...