Postado Junho 11, 2014 11 anos Acabei de fazer aqui, mas nao testei: local function doPlayerAddDepotItems(pid, item, count) local result = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..pid.." ORDER BY `sid` DESC LIMIT 1;") if (result:getID() ~= -1) then local ls = tonumber(result:getDataInt("sid")) return db.executeQuery("INSERT INTO `player_depotitems` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ("..pid..", "..(ls+1)..", 101, "..item..", "..count..", '');") end end local config = { --[posiçao do rank] = {premio, quantidade} [1] = {2160,100}, -- TOP 1 [2] = {2160,60}, -- TOP 2 [3] = {2160,40}, -- TOP 3 [4] = {2160,20}, -- TOP 4 [5] = {2160,10} -- TOP 5 } local days = {"sunday"} -- {Segunda = Monday, Terça = Tuesday, Quarta = Wednesday, Quinta = Thursday, Sexta = Friday, Sabado = Saturday, Domingo = Sunday} local players = {} function onTimer(interval) for d = 1, #days do if os.date("%A"):lower() ~= days[d]:lower() then return true end end local string = "Ganhadores dos premios TOP Rank:\n" for i = 1, #config do local result = db.getResult("SELECT `name`, `id` FROM `players` WHERE `group_id` < 3 AND deleted = 0 ORDER BY `level` DESC, `experience` DESC LIMIT "..(i-1)..", "..i..";") table.insert(players, result:getDataInt("id")) local name = result:getDataString("name") local on = getPlayerByNameWildcard(name) if isCreature(on) then doPlayerAddItem(on, config[i][1], config[i][2]) else doPlayerAddDepotItems(players[i], config[i][1], config[i][2]) end string = string..""..i.." "..name..", premio: "..config[i][2].." "..getItemNameById(config[i][1])..""..(config[i][2] > 1 and "s" or "").."\n" end return doBroadcastMessage(string, MESSAGE_EVENT_ADVANCE) end TAG: <globalevent name="TopReward" time="21:00" event="script" value="Nome Do Arquivo.lua"/>
Postado Junho 11, 2014 11 anos Autor pode falar onde eu ponho para eu nao fazer cagada ? OldTaboos24hpor48h.com Inauguração DOMONIGO as 18:00 | 18/03/2018 | Stages | Custom Map |VENHA SER TOP TABOOS!
Postado Junho 11, 2014 11 anos Autor obg rep + pela ajuda <3 existe algum script para quando o premium acabar os itens da house ir para o dp ? OldTaboos24hpor48h.com Inauguração DOMONIGO as 18:00 | 18/03/2018 | Stages | Custom Map |VENHA SER TOP TABOOS!
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.