Já ganhou meu REP :button_ok: ,valew ![]()
PS: Me ajudou muito.
info
Grupo: Artesão
Registrado: 09/07/11
Posts: 112
Reputação: +114
Char no Tibia: Guuh Kiler

Já ganhou meu REP :button_ok: ,valew ![]()
PS: Me ajudou muito.
info
Grupo: Campones
Registrado: 20/02/09
Posts: 13
Reputação: +1
Char no Tibia: Sir Tiaguin

Não sei como ajudei '-' , mas fico feliz de ajudar
info
Grupo: Artesão
Registrado: 09/07/11
Posts: 112
Reputação: +114
Char no Tibia: Guuh Kiler

Me ajudou passando o script ![]()
info
Grupo: Campones
Registrado: 20/02/09
Posts: 13
Reputação: +1
Char no Tibia: Sir Tiaguin

Desculpe pelo flood.
Estou desde à 6 dias esperando resposta e nada '-'
info
Grupo: Campones
Registrado: 20/02/09
Posts: 13
Reputação: +1
Char no Tibia: Sir Tiaguin

Ta difícil -.- '
Editado Julho 31 por ADM Dark
info
Grupo: Barão
Registrado: 05/08/10
Posts: 218
Reputação: +86
Gênero: Masculino

Testa ae amigo Aki no caso eu fiz para ele sorte Ou mms ou mpa ou entao 200k! se nao funfa avisa
-- Lottery System
local config = {
lottery_hour = "4 Hour", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message)
rewards_id = {2160},{3366},{3414}, -- ID dos Itens Sorteados na Loteria
crystal_counts = 20, -- Usado somente se a rewards_id for crystal coin (ID: 12620).
website = "yes" -- Only if you have php scripts and table `lottery` in your database!
}
function onThink(interval, lastExecution)
if(getWorldCreatures(0) == 0)then
return true
end
local list = {}
for i, tid in ipairs(getPlayersOnline()) do
list[i] = tid
end
local winner = list[math.random(1, #list)]
local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
if(random_item == 12620) then
doPlayerAddItem(winner, random_item, config.crystal_counts)
doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! Congratulations! (Proxima Loteria em " .. config.lottery_hour .. ")")
else
doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. getItemNameById(random_item) .. "! Congratulations! (Proxima Loteria em " .. config.lottery_hour .. ")")
doPlayerAddItem(winner, random_item, 1)
end
if(config.website == "yes") then
db.executeQuery("INSERT INTO `lottery` (`name`, `item`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(random_item) .."');")
end
return true
end
Se ajudei Rep++
info
Grupo: Campones
Registrado: 20/02/09
Posts: 13
Reputação: +1
Char no Tibia: Sir Tiaguin

Amigo eu agradeço, mas o que eu queria é que sortiasse dentre dos os itens e se caso fosse dinheiro a quantidade variava entre 200k~500k
info
Grupo: Barão
Registrado: 05/08/10
Posts: 218
Reputação: +86
Gênero: Masculino

Testa ae agr ele vai alem de poder ganhar os itens o dinheiro vai varear de 200k a 500k
-- Edited By Mulizeu
local config = {
lottery_hour = "4 Hour",
rewards_id = {2160},{3366},{3414},
crystal_counts = 20 or 50,
website = "yes"
}
function onThink(interval, lastExecution)
if(getWorldCreatures(0) == 0)then
return true
end
local list = {}
for i, tid in ipairs(getPlayersOnline()) do
list[i] = tid
end
local winner = list[math.random(1, #list)]
local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
if(random_item == 12620) then
doPlayerAddItem(winner, random_item, config.crystal_counts)
doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! Congratulations! (Proxima Loteria em " .. config.lottery_hour .. ")")
else
doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. getItemNameById(random_item) .. "! Congratulations! (Proxima Loteria em " .. config.lottery_hour .. ")")
doPlayerAddItem(winner, random_item, 1)
end
if(config.website == "yes") then
db.executeQuery("INSERT INTO `lottery` (`name`, `item`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(random_item) .."');")
end
return true
end
info
Grupo: Campones
Registrado: 20/02/09
Posts: 13
Reputação: +1
Char no Tibia: Sir Tiaguin
Bom dia xtibianos !
Segue o script:
-- Lottery System local config = { lottery_hour = "4 Hour", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message) rewards_id = {2160}, -- ID dos Itens Sorteados na Loteria crystal_counts = 20, -- Usado somente se a rewards_id for crystal coin (ID: 12620). website = "yes" -- Only if you have php scripts and table `lottery` in your database! } function onThink(interval, lastExecution) if(getWorldCreatures(0) == 0)then return true end local list = {} for i, tid in ipairs(getPlayersOnline()) do list[i] = tid end local winner = list[math.random(1, #list)] local random_item = config.rewards_id[math.random(1, #config.rewards_id)] if(random_item == 12620) then doPlayerAddItem(winner, random_item, config.crystal_counts) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! Congratulations! (Proxima Loteria em " .. config.lottery_hour .. ")") else doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. getItemNameById(random_item) .. "! Congratulations! (Proxima Loteria em " .. config.lottery_hour .. ")") doPlayerAddItem(winner, random_item, 1) end if(config.website == "yes") then db.executeQuery("INSERT INTO `lottery` (`name`, `item`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(random_item) .."');") end return true endObrigado.