• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AJUDA!!! GOD E GM - Participando do Lottery System.

nilvagner

Long live the otland.net
Joined
May 3, 2010
Messages
118
Reaction score
3
Location
Brazil
Hail ^^

Gente estou mais uma vez aqui para pedir ajudar a vcs que manjam do produto.

Alguém aqui pode me passar um script para o meu GOD e meus GM's não participarem da lottery system.

meu arquivo atual é este:

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Lottery" enabled="yes">
<config name="lottery_config"><![CDATA[
t = {
lottery_hour = "1 hours", -- Time to next lottery (you set the real time on interval, it's only for the broadcast message.)
rewards_id = {2160, 2195, 2534, 2173}, -- ID's of rewards
stackable_amount = 10, -- amount, if this it's a stackable item
website = true -- Do you have `lottery` table in your database?
}
]]></config>
<globalevent name="lottery" interval="600000" event="buffer"><![CDATA[
domodlib('lottery_config')
local list = getPlayersOnline()
if #list > 0 then
local winner, item = list[math.random(#list)], t.rewards_id[math.random(#t.rewards_id)]
local stackable = getItemInfo(item).stackable
doPlayerAddItem(winner, item, stackable and t.stackable_amount or 1)
doBroadcastMessage('[SYSTEM LOTTERY]\nWinner: '.. getCreatureName(winner) ..',\nPremio: '.. (stackable and t.stackable_amount ..' ' or '') .. (stackable and getItemInfo(item).plural or getItemNameById(item)) .. '.\nCongratulations!\n(Next lottery in '.. t.lottery_hour ..')')
if t.website then
db.executeQuery("INSERT INTO `lottery` (`name`, `item`, `world_id`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(item) .."', '".. getConfigValue('worldId') .."');")
end
end
return true
]]></globalevent>
</mod>
 
testa assim ..

Code:
<?xml version="1.0" encoding="UTF-8"?>
 <mod name="Lottery" enabled="yes">
 <config name="lottery_config"><![CDATA[
 t = {
 lottery_hour = "1 hours", -- Time to next lottery (you set the real time on interval, it's only for the broadcast message.)
 rewards_id = {2160, 2195, 2534, 2173}, -- ID's of rewards
 stackable_amount = 10, -- amount, if this it's a stackable item
 website = true -- Do you have `lottery` table in your database?
 }
 ]]></config>
 <globalevent name="lottery" interval="600000" event="buffer"><![CDATA[
 domodlib('lottery_config')
 local list = getPlayersOnline()
 if #list > 0 then
 local winner, item = list[math.random(#list)], t.rewards_id[math.random(#t.rewards_id)]
 local stackable = getItemInfo(item).stackable
 doPlayerAddItem(winner, item, stackable and t.stackable_amount or 1)
 doBroadcastMessage('[SYSTEM LOTTERY]\nWinner: '..  getCreatureName(winner) ..',\nPremio: '.. (stackable and  t.stackable_amount ..' ' or '') .. (stackable and  getItemInfo(item).plural or getItemNameById(item)) ..  '.\nCongratulations!\n(Next lottery in '.. t.lottery_hour ..')')
 if t.website then
 db.executeQuery("INSERT INTO `lottery` (`name`, `item`, `world_id`) WHERE group_id < 2 VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(item)  .."', '".. getConfigValue('worldId') .."');")
 end
 end
 return true
 ]]></globalevent>
 </mod>

REP++
 
RobsonDias, Acredito que o script nãoi irá funcionar, o "God, Cm" continuara recebendo ingame, apenas não irá inserir no banco de dados.
 
Last edited:
Haill br's o/

Robson, não deu cara, ta dando erro aqui :(

Mesmo assim ty !!!

Vou esperar um milagre :)
 
Porque preciso mudar o script de lottery system?
R: Desse jeito como esta, os jogadores vao saber quando o GOD e GM's estão online, mesmo estando no modo ghost.
E que não precisa os admi do ot ganhar itens, hahahahaha :)
 
posta na seção requests > na parte de lua... lá nego vai te ajudar melhor que os br :)
 
Antes dessa linha:

Code:
doPlayerAddItem(winner, item, stackable and t.stackable_amount or 1)

Adicione:

Code:
if (getPlayerGroupId(cid) < 2) then

Troque "2" pelo acesso mínimo que não pode receber o item, no caso dos grupos normais do TFS, 2 refere-se a gamemasters.

E depois disso:

Code:
db.executeQuery("INSERT INTO `lottery` (`name`, `item`, `world_id`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(item) .."', '".. getConfigValue('worldId') .."');")
end

Adicione isso:

Code:
end
 
fiz oque o nostra falou :)
Lua:
<?xml version="1.0" encoding="UTF-8"?>
 <mod name="Lottery" enabled="yes">
 <config name="lottery_config"><![CDATA[
 t = {
 lottery_hour = "1 hours", -- Time to next lottery (you set the real time on interval, it's only for the broadcast message.)
 rewards_id = {2160, 2195, 2534, 2173}, -- ID's of rewards
 stackable_amount = 10, -- amount, if this it's a stackable item
 website = true -- Do you have `lottery` table in your database?
 }
 ]]></config>
 <globalevent name="lottery" interval="600000" event="buffer"><![CDATA[
 domodlib('lottery_config')
 local list = getPlayersOnline()
 if #list > 0 then
 local winner, item = list[math.random(#list)], t.rewards_id[math.random(#t.rewards_id)]
 local stackable = getItemInfo(item).stackable
 doPlayerAddItem(winner, item, stackable and t.stackable_amount or 1)
if (getPlayerGroupId(cid) < 2) then
 doBroadcastMessage('[SYSTEM LOTTERY]\nWinner: '..  getCreatureName(winner) ..',\nPremio: '.. (stackable and  t.stackable_amount ..' ' or '') .. (stackable and  getItemInfo(item).plural or getItemNameById(item)) ..  '.\nCongratulations!\n(Next lottery in '.. t.lottery_hour ..')')
 if t.website then
 db.executeQuery("INSERT INTO `lottery` (`name`, `item`, `world_id`) WHERE group_id < 2 VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(item)  .."', '".. getConfigValue('worldId') .."');")
  end
                end
      end
 return true
 ]]></globalevent>
 </mod>
 
Obrigado Nostradamus! mais deu o mesmo erro que apresentou no script do robson. :(
 
Back
Top