felipejf 1 Postado Janeiro 11, 2012 Share Postado Janeiro 11, 2012 Utilizo este sistema de loteria. local config = { lottery_hour = "3 Hours", -- Tempo para o proximo sorteio (para transmitir mensagens em tempo real [broadcast] basta vc configurar em globalevents.xml) rewards_id = {2494, 2472, 2514, 2160}, -- Premios ID crystal_counts = 10, -- Used only if on rewards_id is crystal coin (ID: 2160). } function onThink(interval, lastExecution) if(getWorldCreatures(0) == 0)then return true end local list = {} for i, tid in ipairs(getPlayersOnline()) do list = tid end local winner = list[math.random(1, #list)] local random_item = config.rewards_id[math.random(1, #config.rewards_id)] if(random_item == 2160) then doPlayerAddItem(winner, random_item, config.crystal_counts) doBroadcastMessage("[LOTTERY SYSTEM] Vencedor: " .. getCreatureName(winner) .. ", Premio: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! Parabens! (Proximo sorteio em " .. config.lottery_hour .. ")") else doBroadcastMessage("[LOTTERY SYSTEM] Vencedor: " .. getCreatureName(winner) .. ", Premio: " .. getItemNameById(random_item) .. "! Parabens! (Proximo sorteio em " .. config.lottery_hour .. ")") doPlayerAddItem(winner, random_item, 1) end return true end O erro que esta acontecendo e que ele esta premiando os Adms, Gms. Gostaria de saber como faz que com que ele não premie os membros de staff. Obrigado. Link para o comentário https://xtibia.com/forum/topic/177731-d%C3%BAvida-sistema-de-loteria/ Compartilhar em outros sites More sharing options...
Posts Recomendados