Tudo que ikaroangelo21 postou
-
(Resolvido)[Action] Bau
@ASSAFSAF. function onUse(cid, item, fromPosition, itemEx, toPosition) local daysvalue = 1 * 60 * 60 -- 1 hora storage = 928938923 local daily = getStorage(getPlayerAccount(cid), 13222423) if getStorage(getPlayerAccount(cid), storage) <= os.time() then setAccountStorageValue(getPlayerAccount(cid), storage, os.time() + daysvalue) local item = doPlayerAddDepotItems(cid, 1990, 0) -- 1990 = id item e 0 townid doItemSetAttribute(item, "description", " Premio Diario [FREE].") doItemSetAttribute(item, 'aid', 10032) doSendMagicEffect(getThingPos(cid), 29) else local left = getStorage(getPlayerAccount(cid), storage) - os.time() left = {hour = math.floor(left/3600), minutes = math.ceil((left % 3600)/60)} doPlayerSendCancel(cid, 'You have to wait '.. left.hour ..'h and '..left.minutes..'min [1 present per account].') doSendMagicEffect(getThingPos(cid), 2) end return true end mudei a função 'getAccountStorageValue' por getStorage.
-
(Resolvido)[Action] Bau
tente assim: function onUse(cid, item, fromPosition, itemEx, toPosition) local daysvalue = 1 * 60 * 60 -- 1 hora storage = 928938923 local daily = getStorage(getPlayerAccount(cid), 13222423) if getStorage(getPlayerAccount(cid), storage) <= os.time() then setAccountStorageValue(getPlayerAccount(cid), storage, os.time() + daysvalue) local item = doPlayerAddDepotItems(cid, 1990, 0) -- 1990 = id item e 0 townid doItemSetAttribute(item, "description", " Premio Diario [FREE].") doItemSetAttribute(item, 'aid', 10032) doSendMagicEffect(getThingPos(cid), 29) else local left = getStorage(getPlayerAccount(cid), storage) - os.time() left = {hour = math.floor(left/3600), minutes = math.ceil((left % 3600)/60)} doPlayerSendCancel(cid, 'You have to wait '.. left.hour ..'h and '..left.minutes..'min [1 present per account].') doSendMagicEffect(getThingPos(cid), 2) end return true end ou function onUse(cid, item, fromPosition, itemEx, toPosition) local daysvalue = 1 * 60 * 60 -- 1 hora storage = 928938923 local daily = getAccountStorageValue(getPlayerAccount(cid), 13222423) if getAccountStorageValue(getPlayerAccount(cid), storage) <= os.time() then setAccountStorageValue(getPlayerAccount(cid), storage, os.time() + daysvalue) local item = doPlayerAddDepotItems(cid, 1990, 0) -- 1990 = id item e 0 townid doItemSetAttribute(item, "description", " Premio Diario [FREE].") doItemSetAttribute(item, 'aid', 10032) doSendMagicEffect(getThingPos(cid), 29) else local left = getAccountStorageValue(getPlayerAccount(cid), storage) - os.time() left = {hour = math.floor(left/3600), minutes = math.ceil((left % 3600)/60)} doPlayerSendCancel(cid, 'You have to wait '.. left.hour ..'h and '..left.minutes..'min [1 present per account].') doSendMagicEffect(getThingPos(cid), 2) end return true end
-
(Resolvido)[Action] Bau
function onUse(cid, item, fromPosition, itemEx, toPosition) local daysvalue = 1 * 60 * 60 -- 1 hora storage = 928938923 local daily = getAccountStorageValue(getPlayerAccountId(cid), 13222423) if getAccountStorageValue(getPlayerAccountId(cid), storage) <= os.time() then setAccountStorageValue(getPlayerAccountId(cid), storage, os.time() + daysvalue) local item = doPlayerSendMailByName(cid, 1990) -- 1990 = id item doItemSetAttribute(item, "description", " Premio Diario [FREE].") doItemSetAttribute(item, 'aid', 10032) doSendMagicEffect(getThingPos(cid), 29) else local left = getAccountStorageValue(getPlayerAccountId(cid), storage) - os.time() left = {hour = math.floor(left/3600), minutes = math.ceil((left % 3600)/60)} doPlayerSendCancel(cid, 'You have to wait '.. left.hour ..'h and '..left.minutes..'min [1 present per account].') doSendMagicEffect(getThingPos(cid), 2) end return true end Qualquer coisa tenta o de baixo: function onUse(cid, item, fromPosition, itemEx, toPosition) local daysvalue = 1 * 60 * 60 -- 1 hora storage = 928938923 local daily = getAccountStorageValue(getPlayerAccountId(cid), 13222423) if getAccountStorageValue(getPlayerAccountId(cid), storage) <= os.time() then setAccountStorageValue(getPlayerAccountId(cid), storage, os.time() + daysvalue) local item = doPlayerAddDepotItems(cid, 1990, 0) -- 1990 = id item e 0 townid doItemSetAttribute(item, "description", " Premio Diario [FREE].") doItemSetAttribute(item, 'aid', 10032) doSendMagicEffect(getThingPos(cid), 29) else local left = getAccountStorageValue(getPlayerAccountId(cid), storage) - os.time() left = {hour = math.floor(left/3600), minutes = math.ceil((left % 3600)/60)} doPlayerSendCancel(cid, 'You have to wait '.. left.hour ..'h and '..left.minutes..'min [1 present per account].') doSendMagicEffect(getThingPos(cid), 2) end return true end
-
(Resolvido)[Action] Bau
Bom dia, qual versão?
-
Object Builder Erro Unsupported Version
@alun0n0v0 <version value="854" string="8.54 v1" dat="32427F92" spr="4B1E2C87" otb="0"/>"
-
(HELP) - Ajuda para copilar Tfs 1.2 Tibia 7.7
@Anivia o tutorial e autoexplicativo, segue uma ordem lógica, no primeiro e para instalar o vcpkg (e descompilar), como você ja tem as source pulará para o item 3. Install libraries, e depois somente seguir o tutorial, lembrando que deve baixar os arquivos antes do item 1. depois somente pular o item 2, como você ja tem as source e seguir a cronologia.
-
OTXServer Global Full by ADM Kabo
qual erro?
-
ESCOLHER CAVE POR ALAVANCA E MOSTRAR MINUTOS E SEGUNDOS NO PISO.
.Qual servidor ou website você utiliza como base? Servidor base 8.60, OTX server. Qual o motivo deste tópico? Boa tarde a todos(das), gostaria que as caves abaixo fossem escolhidas através de alavancas (removendo X item) para dar direito ao uso da cave. Além disto, gostaria que quando o player da cave passar pelo tile da cave, mostra-se hora, minutos e segundos, atualmente apenas mostra minutos. Portanto, em resumo, gostaria que o player escolhe-se a cave por alavanca (removendo X item da backpack) dando direito de uso de 2 horas e quem tenta-se passar pelo tile que não for o dono no momento demonstre a quem possui a cave, exemplo: Esta cave pertente a FULANO, que tem X horas, X minutos e X segundos, e ao proprietário também. Deste modo, grato de imediato, por quem leu ou tentou ajudar. Você tem o código disponível? Se tiver publique-o aqui: PASTA ACTIONS. local function filtrateString(str) if type(str) ~= "string" then return false end local first, last = 0, 0 local second, final = 0, #str local limitedeuso = 49015 local textofinal1 = "Voce ja esta sob efeito da pot de experiencia espere o efeito acabar." for i = 1, #str do if string.byte(str:sub(i,i)) == string.byte('a') then first = i + 2 for t = first, #str do if string.byte(str:sub(t,t)) == string.byte(' ') then last = t - 1 break end end end if string.byte(str:sub(i,i)) == string.byte('b') then second = i + 2 end end return {str:sub(first, last), str:sub(second, final)} end function doPlayerHaveCave(cid) local count = 0 for i = 822081, 822090 do if tonumber(filtrateString(getGlobalStorageValue(i))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(i))[2]) - os.time() > 0 then count = count + 1 end end return count end function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > 15000 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce e maior que level 15000, porem nao pode usar a cave exclusiva.") return false elseif doPlayerHaveCave(cid) > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce ja possui uma cave propria.") return false end if tonumber(filtrateString(getGlobalStorageValue(822081))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822081, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 1 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822082))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822082, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 2 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822083))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822083, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 3 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822084))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822084, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 4 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822085))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822085, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 5 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822086))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822086, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 6 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822087))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822087, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 7 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822088))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822088, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 8 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822089))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822089, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 9 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822090))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822090, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 2)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 10 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822091))[2]) < os.time() then doRemoveItem(item.uid) else doPlayerSendCancel(cid, "Todas as caves já estão com dono no momento. Tente mais tarde.") end return true end PASTA MOVEMENTS: local function filtrateString(str) if type(str) ~= "string" then return false end local first, last = 0, 0 local second, final = 0, #str for i = 1, #str do if string.byte(str:sub(i,i)) == string.byte('a') then first = i + 2 for t = first, #str do if string.byte(str:sub(t,t)) == string.byte(' ') then last = t - 1 break end end end if string.byte(str:sub(i,i)) == string.byte('b') then second = i + 2 end end return {str:sub(first, last), str:sub(second, final)} end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if item.actionid == 3600 then if tonumber(filtrateString(getGlobalStorageValue(822081))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822081))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822081))[2]) - os.time())/60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3601 then if tonumber(filtrateString(getGlobalStorageValue(822082))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822082))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822082))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3602 then if tonumber(filtrateString(getGlobalStorageValue(822083))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822083))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822083))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3603 then if tonumber(filtrateString(getGlobalStorageValue(822084))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822084))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822084))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3604 then if tonumber(filtrateString(getGlobalStorageValue(822085))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822085))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822085))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3605 then if tonumber(filtrateString(getGlobalStorageValue(822086))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822086))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822086))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3606 then if tonumber(filtrateString(getGlobalStorageValue(822087))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822087))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822087))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3607 then if tonumber(filtrateString(getGlobalStorageValue(822088))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822088))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822088))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3608 then if tonumber(filtrateString(getGlobalStorageValue(822089))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822089))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822089))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end elseif item.actionid == 3609 then if tonumber(filtrateString(getGlobalStorageValue(822090))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(822090))[2]) >= os.time() then doPlayerSendTextMessage(cid, 25, "Bem vindo à sua hunt! Aproveite ela, você tem mais "..math.floor((tonumber(filtrateString(getGlobalStorageValue(822090))[2]) - os.time()) / 60).." minutos de hunt.") else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Você não é dono dessa hunt! Para ser dono de uma hunt, compre em nosso website.") end end return true end
-
error ao tentar entrar no otserv
Seu config.lua esta incorreto, poste ele que concerto ! Quando você estava tendando entrar pelo 127.0.0.1 o client identificava o sqlhost, que esta 127.0.0.1 e dava erro, erro simples. coloca: sqlHost = "localhost" E o 192 não tem nada haver com o problema, apenas informações em locais incorretos.
-
Npc bank não funciona
adicione isso em default.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end npcHandler:addModule(FocusModule:new())
-
Npc bank não funciona
@kinomoto posta o script do npc EVA por favor.
-
Npc bank não funciona
data/npc/lib/npcsystem/npchandler.lua (coloque o abaixo).
-
Npc bank não funciona
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local Topic, count, transfer = {}, {}, {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local function getCount(s) local b, e = s:find('%d+') return b and e and math.min(4294967295, tonumber(s:sub(b, e))) or -1 end local function findPlayer(name) local q = db.getResult('SELECT name FROM players WHERE name=' .. db.escapeString(name) .. ' LIMIT 1'), nil if q:getID() == -1 then return end local r = q:getDataString('name') q:free() return r end function greet(cid) Topic[cid], count[cid], transfer[cid] = nil, nil, nil return true end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false elseif msgcontains(msg, 'balance') then npcHandler:say('Your account balance is ' .. getPlayerBalance(cid) .. ' gold.', cid) Topic[cid] = nil elseif msgcontains(msg, 'deposit') and msgcontains(msg, 'all') then if getPlayerMoney(cid) == 0 then npcHandler:say('You don\'t have any gold with you.', cid) Topic[cid] = nil else count[cid] = getPlayerMoney(cid) npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid) Topic[cid] = 2 end elseif msgcontains(msg, 'deposit') then if getCount(msg) == 0 then npcHandler:say('You are joking, aren\'t you??', cid) Topic[cid] = nil elseif getCount(msg) ~= -1 then if getPlayerMoney(cid) >= getCount(msg) then count[cid] = getCount(msg) npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid) Topic[cid] = 2 else npcHandler:say('You do not have enough gold.', cid) Topic[cid] = nil end elseif getPlayerMoney(cid) == 0 then npcHandler:say('You don\'t have any gold with you.', cid) Topic[cid] = nil else npcHandler:say('Please tell me how much gold it is you would like to deposit.', cid) Topic[cid] = 1 end elseif Topic[cid] == 1 then if getCount(msg) == -1 then npcHandler:say('Please tell me how much gold it is you would like to deposit.', cid) Topic[cid] = 1 elseif getPlayerMoney(cid) >= getCount(msg) then count[cid] = getCount(msg) npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid) Topic[cid] = 2 else npcHandler:say('You do not have enough gold.', cid) Topic[cid] = nil end elseif msgcontains(msg, 'yes') and Topic[cid] == 2 then if doPlayerRemoveMoney(cid, count[cid]) then doPlayerSetBalance(cid, getPlayerBalance(cid) + count[cid]) npcHandler:say('Alright, we have added the amount of ' .. count[cid] .. ' gold to your balance. You can withdraw your money anytime you want to.', cid) else npcHandler:say('I am inconsolable, but it seems you have lost your gold. I hope you get it back.', cid) end Topic[cid] = nil elseif msgcontains(msg, 'no') and Topic[cid] == 2 then npcHandler:say('As you wish. Is there something else I can do for you?', cid) Topic[cid] = nil elseif msgcontains(msg, 'withdraw') then if getCount(msg) == 0 then npcHandler:say('Sure, you want nothing you get nothing!', cid) Topic[cid] = nil elseif getCount(msg) ~= -1 then if getPlayerBalance(cid) >= getCount(msg) then count[cid] = getCount(msg) npcHandler:say('Are you sure you wish to withdraw ' .. count[cid] .. ' gold from your bank account?', cid) Topic[cid] = 4 else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end elseif getPlayerBalance(cid) == 0 then npcHandler:say('You don\'t have any money on your bank account.', cid) Topic[cid] = nil else npcHandler:say('Please tell me how much gold you would like to withdraw.', cid) Topic[cid] = 3 end elseif Topic[cid] == 3 then if getCount(msg) == -1 then npcHandler:say('Please tell me how much gold you would like to withdraw.', cid) Topic[cid] = 3 elseif getPlayerBalance(cid) >= getCount(msg) then count[cid] = getCount(msg) npcHandler:say('Are you sure you wish to withdraw ' .. count[cid] .. ' gold from your bank account?', cid) Topic[cid] = 4 else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end elseif msgcontains(msg, 'yes') and Topic[cid] == 4 then if getPlayerBalance(cid) >= count[cid] then doPlayerAddMoney(cid, count[cid]) doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid]) npcHandler:say('Here you are, ' .. count[cid] .. ' gold. Please let me know if there is something else I can do for you.', cid) else npcHandler:say('There is not enough gold on your account.', cid) end Topic[cid] = nil elseif msgcontains(msg, 'no') and Topic[cid] == 4 then npcHandler:say('The customer is king! Come back anytime you want to if you wish to withdraw your money.', cid) Topic[cid] = nil elseif msgcontains(msg, 'transfer') then if getCount(msg) == 0 then npcHandler:say('Please think about it. Okay?', cid) Topic[cid] = nil elseif getCount(msg) ~= -1 then count[cid] = getCount(msg) if getPlayerBalance(cid) >= count[cid] then npcHandler:say('Who would you like to transfer ' .. count[cid] .. ' gold to?', cid) Topic[cid] = 6 else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end else npcHandler:say('Please tell me the amount of gold you would like to transfer.', cid) Topic[cid] = 5 end elseif Topic[cid] == 5 then if getCount(msg) == -1 then npcHandler:say('Please tell me the amount of gold you would like to transfer.', cid) Topic[cid] = 5 else count[cid] = getCount(msg) if getPlayerBalance(cid) >= count[cid] then npcHandler:say('Who would you like to transfer ' .. count[cid] .. ' gold to?', cid) Topic[cid] = 6 else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end end elseif Topic[cid] == 6 then local v = getPlayerByName(msg) if getPlayerBalance(cid) >= count[cid] then if v then transfer[cid] = msg npcHandler:say('Would you really like to transfer ' .. count[cid] .. ' gold to ' .. getPlayerName(v) .. '?', cid) Topic[cid] = 7 elseif findPlayer(msg):lower() == msg:lower() then transfer[cid] = msg npcHandler:say('Would you really like to transfer ' .. count[cid] .. ' gold to ' .. findPlayer(msg) .. '?', cid) Topic[cid] = 7 else npcHandler:say('This player does not exist.', cid) Topic[cid] = nil end else npcHandler:say('There is not enough gold on your account.', cid) Topic[cid] = nil end elseif Topic[cid] == 7 and msgcontains(msg, 'yes') then if getPlayerBalance(cid) >= count[cid] then local v = getPlayerByName(transfer[cid]) if v then doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid]) doPlayerSetBalance(v, getPlayerBalance(v) + count[cid]) npcHandler:say('Very well. You have transferred ' .. count[cid] .. ' gold to ' .. getPlayerName(v) .. '.', cid) elseif findPlayer(transfer[cid]):lower() == transfer[cid]:lower() then doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid]) db.executeQuery('UPDATE players SET balance=balance+' .. count[cid] .. ' WHERE name=' .. db.escapeString(transfer[cid]) .. ' LIMIT 1') npcHandler:say('Very well. You have transferred ' .. count[cid] .. ' gold to ' .. findPlayer(transfer[cid]) .. '.', cid) else npcHandler:say('This player does not exist.', cid) end else npcHandler:say('There is not enough gold on your account.', cid) end Topic[cid] = nil elseif Topic[cid] == 7 and msgcontains(msg, 'no') then npcHandler:say('Alright, is there something else I can do for you?', cid) Topic[cid] = nil elseif msgcontains(msg, 'change gold') then npcHandler:say('How many platinum coins would you like to get?', cid) Topic[cid] = 8 elseif Topic[cid] == 8 then if getCount(msg) < 1 then npcHandler:say('Hmm, can I help you with something else?', cid) Topic[cid] = nil else count[cid] = math.min(500, getCount(msg)) npcHandler:say('So you would like me to change ' .. count[cid] * 100 .. ' of your gold coins into ' .. count[cid] .. ' platinum coins?', cid) Topic[cid] = 9 end elseif Topic[cid] == 9 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2148, count[cid] * 100) then npcHandler:say('Here you are.', cid) doPlayerAddItem(cid, 2152, count[cid]) else npcHandler:say('Sorry, you do not have enough gold coins.', cid) end else npcHandler:say('Well, can I help you with something else?', cid) end Topic[cid] = nil elseif msgcontains(msg, 'change platinum') then npcHandler:say('Would you like to change your platinum coins into gold or crystal?', cid) Topic[cid] = 10 elseif Topic[cid] == 10 then if msgcontains(msg, 'gold') then npcHandler:say('How many platinum coins would you like to change into gold?', cid) Topic[cid] = 11 elseif msgcontains(msg, 'crystal') then npcHandler:say('How many crystal coins would you like to get?', cid) Topic[cid] = 13 else npcHandler:say('Well, can I help you with something else?', cid) Topic[cid] = nil end elseif Topic[cid] == 11 then if getCount(msg) < 1 then npcHandler:say('Hmm, can I help you with something else?', cid) Topic[cid] = nil else count[cid] = math.min(500, getCount(msg)) npcHandler:say('So you would like me to change ' .. count[cid] .. ' of your platinum coins into ' .. count[cid] * 100 .. ' gold coins for you?', cid) Topic[cid] = 12 end elseif Topic[cid] == 12 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2152, count[cid]) then npcHandler:say('Here you are.', cid) doPlayerAddItem(cid, 2148, count[cid] * 100) else npcHandler:say('Sorry, you do not have enough platinum coins.', cid) end else npcHandler:say('Well, can I help you with something else?', cid) end Topic[cid] = nil elseif Topic[cid] == 13 then if getCount(msg) < 1 then npcHandler:say('Hmm, can I help you with something else?', cid) Topic[cid] = nil else count[cid] = math.min(500, getCount(msg)) npcHandler:say('So you would like me to change ' .. count[cid] * 100 .. ' of your platinum coins into ' .. count[cid] .. ' crystal coins for you?', cid) Topic[cid] = 14 end elseif Topic[cid] == 14 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2152, count[cid] * 100) then npcHandler:say('Here you are.', cid) doPlayerAddItem(cid, 2160, count[cid]) else npcHandler:say('Sorry, you do not have enough platinum coins.', cid) end else npcHandler:say('Well, can I help you with something else?', cid) end Topic[cid] = nil elseif msgcontains(msg, 'change crystal') then npcHandler:say('How many crystal coins would you like to change into platinum?', cid) Topic[cid] = 15 elseif Topic[cid] == 15 then if getCount(msg) == -1 or getCount(msg) == 0 then npcHandler:say('Hmm, can I help you with something else?', cid) Topic[cid] = nil else count[cid] = math.min(500, getCount(msg)) npcHandler:say('So you would like me to change ' .. count[cid] .. ' of your crystal coins into ' .. count[cid] * 100 .. ' platinum coins for you?', cid) Topic[cid] = 16 end elseif Topic[cid] == 16 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2160, count[cid]) then npcHandler:say('Here you are.', cid) doPlayerAddItem(cid, 2152, count[cid] * 100) else npcHandler:say('Sorry, you do not have enough crystal coins.', cid) end else npcHandler:say('Well, can I help you with something else?', cid) end Topic[cid] = nil elseif msgcontains(msg, 'change') then npcHandler:say('There are three different coin types in Tibia: 100 gold coins equal 1 platinum coin, 100 platinum coins equal 1 crystal coin. So if you\'d like to change 100 gold into 1 platinum, simply say \'{change gold}\' and then \'1 platinum\'.', cid) Topic[cid] = nil elseif msgcontains(msg, 'bank') then npcHandler:say('We can change money for you. You can also access your bank account.', cid) Topic[cid] = nil end return true end npcHandler:setCallback(CALLBACK_GREET, greet) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -- function maded by Gesior-- function getNumber(txt) --return number if its number and is > 0, else return 0 x = string.gsub(txt,"%a","") x = tonumber(x) if x ~= nill and x > 0 then return x else return 0 end end
-
(Resolvido)[AJUDA] adicionar nova moeda na loterry
w local config = { lottery_hour = "2 hours", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message) rewards_id = {2494, 2472, 2514, 2160, 12672}, -- ID dos Itens Sorteados na Loteria crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160). moeda_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 12672). website = "yes", -- Only if you have php scripts and table `lottery` in your database! days = { "Monday-08:00", "Monday-13:00", "Monday-19:30", "Tuesday-08:00", "Tuesday-13:00", "Tuesday-19:30", "Wednesday-08:00", "Wednesday-13:00", "Wednesday-19:30", "Thursday-08:00", "Thursday-13:00", "Thursday-19:30", "Friday-01:22", "Friday-13:00", "Friday-19:30", "Saturday-21:27", "Saturday-21:28", "Saturday-21:29", "Sunday-08:00", "Sunday-13:00", "Sunday-19:30" } } local function getPlayerWorldId(cid) if not(isPlayer(cid)) then return false end local pid = getPlayerGUID(cid) local worldPlayer = 0 local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";") if(result_plr:getID() ~= -1) then worldPlayer = tonumber(result_plr:getDataInt("world_id")) result_plr:free() return worldPlayer end return false end local function getOnlineParticipants() local players = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerAccess(pid) <= 2 and getPlayerStorageValue(pid, 281821) <= os.time() then table.insert(players, pid) end end if #players > 0 then return players end return false end function onThink(cid, interval) if table.find(config.days, os.date("%A-%H:%M")) then if(getWorldCreatures(o) <= 0)then return true end local query = db.query or db.executeQuery local random_item = config.rewards_id[math.random(1, #config.rewards_id)] local item_name = getItemNameById(random_item) local data = os.date("%d/%m/%Y - %H:%M:%S") local online = getOnlineParticipants() if online then local winner = online[math.random(1, #online)] local world = tonumber(getPlayerWorldId(winner)) if(random_item == 2160) then doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) doPlayerAddItem(winner, random_item, config.crystal_counts) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .." " .. getItemNameById(random_item) .. "s! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") else doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " ..getItemNameById(random_item) .. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") doPlayerAddItem(winner, random_item, 1) end if(random_item == 12672) then doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) doPlayerAddItem(winner, random_item, config.crystal_counts) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.moeda_counts .." " .. getItemNameById(random_item) .. "s! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") else doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " ..getItemNameById(random_item) .. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") doPlayerAddItem(winner, random_item, 1) end if(config.website == "yes") then query("INSERT INTO `lottery` (`name`, `item`, `world_id`, `item_name`, `date`) VALUES ('".. getCreatureName(winner).."', '".. random_item .."', '".. world .."', '".. item_name .."', '".. data .."');") end else print("Ninguem OnLine pra ganhar na loteria") end end return true end
-
(Resolvido)Task System 4.0 (Vodkart) - Alterar getCreatureName(target)
Mas em sua pasta .../ancient cyclops.xml na parte 'name=' está somente Cyclops, assim em jogo ele aparece seu nome como Cyclops normal, mas sera um ancient cyclops. O script trabalha com o nome da criatura in-game, se esta cyclops, vai contar cyclops !
-
Meu market não funciona
Usa TFS qual versão ou Otx?
-
Meu market não funciona
@kinomoto poste o market system por favor.
-
Function não existe
@kinomoto cria outro tópico sob o market para podermos ajudar.
-
Function não existe
Somente clicar na seta no campo direito inferior :), boa sorte com seu Otserv, precisando somente falar ^^.
-
Function não existe
Teste esse: http://codepad.org/V1CQySHb <action itemid="ID DO ITEM" script="NOMEDOARQUIVO.lua"/>
-
(NPC) Exausted ao viajar.
@Diego767 Posta o script do npc por gentileza (os dois).
-
Function não existe
Esse script e da obsidian knife, exato? Você quer por level minimo?
-
object builder [custom sprites]
good morning, change the object builder, to another, there are several in the forum!
-
Function não existe
Bom dia, poste o script, para darmos uma lida !
-
LOOK ITENS NO CAST (ESPECTADOR)
.Qual servidor ou website você utiliza como base? TIBIA 8.60, OTX. Qual o motivo deste tópico? Queria saber se é possível colocar que o espectador dê look nos itens e ver os detalhes (dos que o cara que esta transmitindo estiver em seu inventário ou usando). Desta maneira: 00:49 You see a lucky clover amulet. It weighs 1.50 oz. It is rumoured to bring you good luck! Luck sponsored by TibiaLottery. Resumindo: Se possível, quero que o espectador consiga dar LOOK nos itens igual o rapaz que esta transmitindo (player normal) e consiga ver todos os detalhes. @Vodkart, caso possa ajudar, serei imensamente grato. Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: <?xml version="1.0" encoding="UTF-8"?> <mod name="Mod Cast" version="1.0" author="Martyx" contact="martyx@otland.net" enabled="yes"> <event type="logout" name="cast-log-out" event="script"><![CDATA[ function onLogout(cid, forceLogout) if(getCreatureNoMove(cid)) then return false end if(not hasPlayerClient(cid)) then db.executeQuery("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") else db.executeQuery("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") end setPlayerStorageValue(cid, 45503, 0) -- set cast off command setPlayerStorageValue(cid, 45504, 0) -- set cast password off command doCreatureSetStorage(cid, "save") return true end ]]></event> <globalevent name="viewers" interval="10000" event="script"><![CDATA[ function onThink(interval) local players = getPlayersOnline() for _, pid in ipairs(players) do local data = getPlayerSpectators(pid) if(data.broadcast) then db.executeQuery("UPDATE `players` SET `viewers` = " .. table.maxn(data.names) .. " WHERE `id` = " .. getPlayerGUID(pid) .. ";") end end return true end ]]></globalevent> <talkaction words="/cast;!cast" event="script"><![CDATA[ function onSay(cid, words, param, channelId) local t, data = string.explode(param, " ", 1), getPlayerSpectators(cid) if(isInArray({'off', 'no', 'disable'}, t[1])) then if getPlayerStorageValue(cid, 45503) > 0 then data.mutes = {} data.broadcast = false doPlayerSetSpectators(cid, data) setPlayerStorageValue(cid, 45503, 0) db.executeQuery("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have disabled your cast stream.") local rates = getPlayerRates(cid) if getPlayerStorageValue(cid, 45504) <= 0 then -- Check cast Password doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]-0.05) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your cast stream already disabled.") return true end elseif(isInArray({'on', 'yes', 'enable'}, t[1])) then if getPlayerStorageValue(cid, 45503) <= 0 then data.broadcast = true doPlayerSetSpectators(cid, data) doPlayerOpenPrivateChannel(cid) setPlayerStorageValue(cid, 45503, 1) db.executeQuery("UPDATE `players` SET `broadcasting` = 1 WHERE `id` = " .. getPlayerGUID(cid)) local rates = getPlayerRates(cid) if getPlayerStorageValue(cid, 45504) <= 0 then -- Check cast Password doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+0.05) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled your cast stream and are getting +5% monsters experience.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled your cast stream. Remove the password to gain +5% monsters experience.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your cast stream already enabled.") return true end elseif(isInArray({'show', 'count', 'see'}, t[1])) then if(data.broadcast) then local count = table.maxn(data.names) if(count > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are currently watched by " .. count .. " people.") local str = "" for _, name in ipairs(data.names) do str = str .. (str:len() > 0 and ", " or "") .. name end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str .. ".") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "None is watching your stream right now.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not streaming right now.") end elseif(isInArray({'kick', 'remove'}, t[1])) then if(data.broadcast) then if(t[2]) then if(t[2] ~= "all") then local found = false for _, name in ipairs(data.names) do if(t[2]:lower() == name:lower()) then found = true break end end if(found) then table.insert(data.kick, t[2]) doPlayerSetSpectators(cid, data) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " has been kicked.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " not found.") end else data.kick = data.names doPlayerSetSpectators(cid, data) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to type a name.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not streaming right now.") end elseif(isInArray({'ban', 'block'}, t[1])) then if(data.broadcast) then if(t[2]) then local found = false for _, name in ipairs(data.names) do if(t[2]:lower() == name:lower()) then found = true break end end if(found) then table.insert(data.bans, t[2]) doPlayerSetSpectators(cid, data) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " has been banned.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " not found.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to type a name.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not streaming right now.") end elseif(isInArray({'unban', 'unblock'}, t[1])) then if(data.broadcast) then if(t[2]) then local found, i = 0, 1 for _, name in ipairs(data.bans) do if(t[2]:lower() == name:lower()) then found = i break end i = i + 1 end if(found > 0) then table.remove(data.bans, found) doPlayerSetSpectators(cid, data) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " has been unbanned.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " not found.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to type a name.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not streaming right now.") end elseif(isInArray({'bans', 'banlist'}, t[1])) then if(table.maxn(data.bans)) then local str = "" for _, name in ipairs(data.bans) do str = str .. (str:len() > 0 and ", " or "") .. name end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently banned spectators: " .. str .. ".") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your ban list is empty.") end elseif(isInArray({'mute', 'squelch'}, t[1])) then if(data.broadcast) then if(t[2]) then local found = false for _, name in ipairs(data.names) do if(t[2]:lower() == name:lower()) then found = true break end end if(found) then table.insert(data.mutes, t[2]) doPlayerSetSpectators(cid, data) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " has been muted.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " not found.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to type a name.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not streaming right now.") end elseif(isInArray({'unmute', 'unsquelch'}, t[1])) then if(data.broadcast) then if(t[2]) then local found, i = 0, 1 for _, name in ipairs(data.mutes) do if(t[2]:lower() == name:lower()) then found = i break end i = i + 1 end if(found > 0) then table.remove(data.mutes, found) doPlayerSetSpectators(cid, data) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " has been unmuted.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Spectator " .. t[2] .. " not found.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to type a name.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not streaming right now.") end elseif(isInArray({'mutes', 'mutelist'}, t[1])) then if(table.maxn(data.mutes)) then local str = "" for _, name in ipairs(data.mutes) do str = str .. (str:len() > 0 and ", " or "") .. name end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently muted spectators: " .. str .. ".") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your mute list is empty.") end elseif(isInArray({'auth', 'protect', 'protection', 'protected'}, t[1])) then if(isInArray({'off', 'no', 'disable'}, t[2])) then data.auth = false doPlayerSetSpectators(cid, data) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your chat is now unprotected, all spectators can chat without authentication.") elseif(isInArray({'on', 'yes', 'enable'}, t[2])) then data.auth = true doPlayerSetSpectators(cid, data) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your chat is now protected, all spectators have to authenticate before they can talk.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your chat is currently " .. (data.auth and "protected" or "unprotected") .. " from guests.") end elseif(isInArray({'password', 'guard'}, t[1])) then if(t[2]) then if(isInArray({'off', 'no', 'disable'}, t[2])) then if(data.password:len() ~= 0) then db.executeQuery("UPDATE `players` SET `broadcasting` = `broadcasting` - 2 WHERE `id` = " .. getPlayerGUID(cid)) end data.password = "" doPlayerSetSpectators(cid, data) local rates = getPlayerRates(cid) if getPlayerStorageValue(cid, 45503) > 0 and getPlayerStorageValue(cid, 45504) > 0 then -- Check Cast On and password doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+0.05) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have removed password for your cast stream and getting +5% monsters experience.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have removed password for your cast stream.") end setPlayerStorageValue(cid, 45504, 0) else if(data.password:len() ~= 0) then db.executeQuery("UPDATE `players` SET `broadcasting` = `broadcasting` + 2 WHERE `id` = " .. getPlayerGUID(cid)) end data.password = string.trim(t[2]) doPlayerSetSpectators(cid, data) local rates = getPlayerRates(cid) if getPlayerStorageValue(cid, 45503) > 0 and getPlayerStorageValue(cid, 45504) <= 0 then -- Check Cast On and password off doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]-0.05) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have set new password for your stream. Remove the password to gain +5% monsters experience.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have set new password for your stream.") end setPlayerStorageValue(cid, 45504, 1) end elseif(data.password ~= "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your stream is currently protected with password: " .. data.password .. ".") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your stream is currently not protected.") end elseif(isInArray({'status', 'info'}, t[1])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your stream is currently " .. (data.broadcast and "enabled" or "disabled") .. ".") else doPlayerPopupFYI(cid, "Available commands:\n\n/cast on - enables the stream\n/cast off - disables the stream\n/cast password {password} - sets a password on the stream\n/cast password off - disables the password protection\n/cast auth on - enables requirement of authentication on chat\n/cast auth off - disables requirement of authentication on chat\n/cast kick {name} - kick a spectator from your stream\n/cast ban {name} - locks spectator IP from joining your stream\n/cast unban {name} - removes banishment lock\n/cast bans - shows banished spectators list\n/cast mute {name} - mutes selected spectator from chat\n/cast unmute {name} - removes mute\n/cast mutes - shows muted spectators list\n/cast show - displays the amount and nicknames of current spectators\n/cast status - displays stream status") end return true end ]]></talkaction> </mod> Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.