Jump to content
  • 0

vidalokkka

Question

bom achei esse scripts

de rank frags

mais ele é de mods

<?xml version="1.0" encoding="UTF-8"?> 
<mod name="rank frag" version="1.0" author="Vodkart" contact="xtibia.com" enabled="yes"> 
<config name="rankf_func"><![CDATA[
storage = 824544
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
function setFrags(cid)
setPlayerStorageValue(cid, storage, getPlayerFrags(cid))
doPlayerSave(cid)
end
function getRankStorage(cid, value, max, RankName) -- by vodka
local str =""
str = "--[".. (RankName == nil and "RANK STORAGE" or ""..RankName.."") .."]--\n\n"
local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as INTEGER) DESC;")
if (query:getID() ~= -1) then k = 1 repeat if k > max then break end
str = str .. "\n " .. k .. ". "..getPlayerNameByGUID(query:getDataString("player_id")).." - [" .. query:getDataInt("value") .. "]"
k = k + 1 until not query:next() end return doPlayerPopupFYI(cid, str)
end
]]></config>
<talkaction words="/rankfrags;!rankfrags" event="buffer"><![CDATA[
domodlib('rankf_func')
return getRankStorage(cid, storage, 20, "Rank Frag")
]]></talkaction> 
<event type="login" name="RankfLogin" event="script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid, "RankfKill")
registerCreatureEvent(cid, "RankfLogin")
setFrags(cid)
return true
end]]></event>	 
<event type="kill" name="RankfKill" event="script"><![CDATA[
domodlib('rankf_func')
function onKill(cid, target, lastHit)
if (isPlayer(cid) == true) and (isPlayer(target) == true) then
addEvent(setFrags, 100, cid)
end
return true
end]]></event>
</mod>

meu ot não tem essa pasta mods ele versão

840 se alguém pode me ajuda REP+++

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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