Ir para conteúdo
  • Cadastre-se

Posts Recomendados

MOD CAST OTX-TFS

HAIL TK!

  • VENHO HOJE TRAZER SOLUÇÃO DE PROBLEMAS DE MUITOS USUÁRIOS AQUI NO TK QUE NÃO CONSEGUE ATIVA O CAST COM SCRIPTS DO FÓRUM
  • UTILIZADO PARA VERSÃO 8.60
  • VAMOS LA? 

 

Crie um Arquivo com Nome mod_cast.xml na pasta /Mods/

e adicione o seguinte script 

Citar

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Mod Cast" version="1.0" author="Antipush" contact="[email protected]" enabled="yes">
    <event type="logout" name="cast-log-out" event="script"><![CDATA[
        function onLogout(cid, forceLogout)
            db.query("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
            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.query("UPDATE `players` set `viewers` = " .. table.maxn(data.names) .. " where `id` = " .. getPlayerGUID(pid) .. ";")
                end
            end
            return true
        end
    ]]></globalevent>
    <talkaction words="/live;!live" 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
                data.mutes = {}
                data.broadcast = false
                doPlayerSetSpectators(cid, data)
                db.query("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid))
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have disabled your live stream.")
            elseif(isInArray({'on', 'yes', 'enable'}, t[1])) then
                data.broadcast = true
                doPlayerSetSpectators(cid, data)
                db.query("UPDATE `players` SET `broadcasting` = 1 WHERE `id` = " .. getPlayerGUID(cid))
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled your live stream.")
            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.query("UPDATE `players` SET `broadcasting` = `broadcasting` - 2 WHERE `id` = " .. getPlayerGUID(cid))
                        end
                        data.password = ""
                        doPlayerSetSpectators(cid, data)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have removed password for your stream.")
                    else
                        if(data.password:len() ~= 0) then
                            db.query("UPDATE `players` SET `broadcasting` = `broadcasting` + 2 WHERE `id` = " .. getPlayerGUID(cid))
                        end
                        data.password = string.trim(t[2])
                        doPlayerSetSpectators(cid, data)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have set new password for your stream.")
                    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/live on - enables the stream\n/live off - disables the stream\n/live password {password} - sets a password on the stream\n/live password off - disables the password protection\n/live auth on - enables requirement of authentication on chat\n/live auth off - disables requirement of authentication on chat\n/live kick {name} - kick a spectator from your stream\n/live ban {name} - locks spectator IP from joining your stream\n/live unban {name} - removes banishment lock\n/live bans - shows banished spectators list\n/live mute {name} - mutes selected spectator from chat\n/live unmute {name} - removes mute\n/live mutes - shows muted spectators list\n/live show - displays the amount and nicknames of current spectators\n/live status - displays stream status")
            end
            return true
        end
    ]]></talkaction>
</mod>

Em /data/creaturescript/ crie um arquivo com nome castlogout.lua e adicione 

Citar

function onLogout(cid, forceLogout)
        db.query("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
        return true
end

Em Talkactions crie um arquivo com nome cast.lua e adicione

Citar

function onSay(cid, words, param, channelId)
    local t, data = string.explode(param, " ", 1), getPlayerSpectators(cid)
    if(isInArray({'off', 'no', 'disable'}, t[1])) then
        data.mutes = {}
        data.broadcast = false
        doPlayerSetSpectators(cid, data)

        db.query("UPDATE `players` SET `broadcasting` = 0, `viewers` = 0 WHERE `id` = " .. getPlayerGUID(cid))
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have disabled your cast stream.")
    elseif(isInArray({'on', 'yes', 'enable'}, t[1])) then
        data.broadcast = true
        doPlayerSetSpectators(cid, data)
        doPlayerOpenPrivateChannel(cid)
        db.query("UPDATE `players` SET `broadcasting` = 1 WHERE `id` = " .. getPlayerGUID(cid))
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled your cast stream.")
    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.query("UPDATE `players` SET `broadcasting` = `broadcasting` - 2 WHERE `id` = " .. getPlayerGUID(cid))
                end

                data.password = ""
                doPlayerSetSpectators(cid, data)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have removed password for your stream.")
            else
                if(data.password:len() ~= 0) then
                    db.query("UPDATE `players` SET `broadcasting` = `broadcasting` + 2 WHERE `id` = " .. getPlayerGUID(cid))
                end

                data.password = string.trim(t[2])
                doPlayerSetSpectators(cid, data)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have set new password for your stream.")
            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
 

TAG= <talkaction words="/cast;!cast" event="script" value="cast.lua"/>

Ultima Parte crie uma conta em sua db com login 10 e senha qualquer uma. (nao crie character no login 10)

Diga /cast , /cast on /cast off ect..

                                                                              Rep+?

                                                                                                        creditos    

                                                                                                        Antipush

                                                                                                         Matryx           

                            

                                                                               Procura um Excelente Serviço Para Hospeda Seu Projeto?

 

                                                                                             lott.png.812bc38a46bc22d8a374ef316eb3b472.png

                                                                      Damos Suporte Para openTibia, pm! melhores preços do mercado!! 

Editado por Antipush
creditos (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Moderador

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites
  • 1 month later...

cara a função /cast on não funciona nesse script e sim !live on como troco isso... e como faz para que assim que um player entrar no cast de outro abra a aba altomaticamente do cast 

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Absolute
      Olá amigos, membros, visitantes, papagaios, enfim...

      Depois de muito me pedirem o evento SNOWBAL WAR EVENT, trago ele 100% pra vocês.

      Como funciona?
      Os jogadores irão se divertir em uma emocionante partida de guerra de bolas de neve. O objetivo principal do evento é derrubar o número máximo de jogadores durante uma partida - atirando bolas de neve contra seus inimigos. O jogador que mais pontos fizer até o termino do evento será o vencedor (recompensa pode ser configurada).

      Sem delongas, vamos ao que interessa...
       
       
       
       

      Em data/actions abra o seu actions.xml e insira a seguinte linha:
       
       
      <action actionid="7900" event="script" value="snowballaction.lua" />

      Em data/actions/scripts crie um arquivo com o nome de snowballaction.lua e insira o seguinte conteúdo:
      function onUse(cid, item, frompos, item2, topos) if item.actionid == 7900 then if(SBW_AMMOINFI) then doPlayerSendTextMessage(cid, 27, "as bolas de neve sao infinitas, nao ha necessidade que voce compre-as.") else if (getPlayerStorageValue(cid, SBW_SCORE) > 0) and (getPlayerStorageValue(cid, SBW_AMMO) < 30) then doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1) doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)+SBW_AMMOBUY) doPlayerSendTextMessage(cid, 27, "Voce trocou " .. SBW_AMMOBUY .. "x bolas de neve por 1 ponto de placar.") doSendMagicEffect(getCreaturePosition(cid),4) else doPlayerSendTextMessage(cid, 27, "Voce nao possui pontos de jogo o suficiente ou ja esta carregando muitas bolas de neve.") end end end end  
       
       
       

      Em data/talkactions abra o seu talkactions.xml e insira a seguinte linha:
       
      <talkaction words="!snowball" event="script" value="snowballtalk.lua"/>

      Em data/talkactions/scripts crie um arquivo com o nome de snowballtalk.lua e insira o seguinte conteúdo:
      function onSay(cid, words, param, channel) local k = string.explode(param, ",") if(k[1] ~= nil) then if(string.upper(k[1]) == 'INFO') then local score = {} local output = "Voce tem " .. getPlayerStorageValue(cid, SBW_SCORE) .. " pontos.\nVoce tem "..getPlayerStorageValue(cid, SBW_AMMO).."x municoes.\n------------------\nO maior matador:\n" for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, SBW_INEVENT) then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)}) end end local lx = table.getn(score) if(lx > 3) then lx = 3 end table.sort(score, function(a, b) return a[2] > b[2] end) for k = 1,lx do output = output .. k..". "..score[k][1] .." [".. score[k][2] .."].\n" end doPlayerPopupFYI(cid, output) end if (string.upper(k[1]) == 'ATIRAR') then if(getPlayerStorageValue(cid, SBW_INEVENT) == 1) and not getTileInfo(getThingPos(cid)).protection then if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then if(getPlayerStorageValue(cid, SBW_AMMO) > 0) then if SBW_STATUS == 'on' then if(SBW_AMMOINFI == false) then doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)-1) end doPlayerSetStorageValue(cid, SBW_EXAUSTHED, 2) lineAnimation(getPlayerLookDirection(cid),getCreaturePosition(cid),12,cid,1,0,1,0,0,0,1,0) addEvent(doPlayerSetStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1) if (getPlayerStorageValue(cid, SBW_AMMO) ~= 1) then doPlayerSendTextMessage(cid, 27, "Restam "..getPlayerStorageValue(cid, SBW_AMMO).."x bolas de neve.") else doPlayerSendTextMessage(cid, 27, "Usando sua ultima bola de neve, recarregue.") end end else doPlayerSendCancel(cid, "Voce esta sem bolas de neve, recarregue no centro do campo ou mate um inimigo.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerPopupFYI(cid, "Acalme-se voce deve esperar para atirar novamente.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return false end else doPlayerPopupFYI(cid, "Voce precisa estar dentro evento ou fora da pz.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end end end return true end function lineAnimation(lookDir,playerPos,effect,cid,fvar,fpos,ffound,fposV,fcheck,fvcid,floopCounter,fvpid, name) local var = fvar local pos = fpos local found = ffound local posV = fposV local check = fcheck local vcid = fvcid local loopCounter = floopCounter local vpid = fvpid local storage = SBW_EXAUSTHED if var < 2 then vcid = cid end pos = playerPos if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then doSendDistanceShoot(pos, convert(lookDir,pos),effect) pos = convert(lookDir,pos) var=var+1 posV = convertV(lookDir,playerPos) for _, pid in ipairs(getPlayersOnline()) do if (getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z) then --if loopCounter > 2 then vpid = pid --end if (vpid ~= vcid) then if var > 2 then if (getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z) then killPlayer(pid,pos,getCreatureName(vcid)) if (lookDir == 0) or (lookDir == 2) then var = 6 else var = 8 end end end killPlayer(pid,pos,vcid) if (lookDir == 0) or (lookDir == 2) then var = 6 else var = 8 end end end loopCounter = loopCounter +1 end if (lookDir == 0) or (lookDir == 2) then if var ~= 6 then addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid) else var = 1 end else if var ~= 8 then addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid) else var = 1 end end else doSendMagicEffect(convert(lookDir,pos),2) var = 1 end end local ret = {} function convert(lookDir,pos) local positions = { [0] = {x = pos.x, y = pos.y-1, z = pos.z}, [1] = {x = pos.x+1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y+1, z = pos.z}, [3] = {x = pos.x-1, y = pos.y, z = pos.z} } ret = positions[lookDir] return ret end local ret = {} function convertV(lookDir,pos) local positions = { [0] = {x = pos.x, y = pos.y+1, z = pos.z}, [1] = {x = pos.x-1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y-1, z = pos.z}, [3] = {x = pos.x+1, y = pos.y, z = pos.z} } ret = positions[lookDir] return ret end function isInWallArray(pos) for k = 0, table.getn(SBW_WALLSID) do if getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k] then --this doesn't even make sense but tried other ways and it gave errors, so meh 2lazy2search return true end end return false end function killPlayer(cid, pos, killer) local t_l = SBW_AREA[1] local b_r = SBW_AREA[2] local posti = {} local isPossibleToTeleportPlayer = false while (isPossibleToTeleportPlayer == FALSE) do posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7) if isInWallArray(posti) == FALSE then isPossibleToTeleportPlayer = TRUE end end doTeleportThing(cid, posti) doSendMagicEffect(pos,2) doSendMagicEffect(posti,6) doSendAnimatedText(pos, ""..getCreatureName(killer).." ", 55) doPlayerSendTextMessage(cid, 27, "Voce morreu para "..getCreatureName(killer)..".") doPlayerSetStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE)+SBW_POINTSKILL) doPlayerSendTextMessage(killer, 27, "You've killed "..getCreatureName(cid)..".") if SBW_LOSTSCORE then doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1) end if SBW_RESETAMMO then doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO) end end  
       
       
       
       
      Em data/globalevents abra o seu globalevents.xml e insira a seguinte linha:
      <globalevent name="StartSBW" time="19:00" event="script" value="events/snowballglobalevent.lua"/>
      Em data/globalevents/scripts crie um arquivo com o nome de snowballglobalevent.lua e insira o seguinte conteúdo:
      function onTime() function isInWallArray(pos) for k = 0, table.getn(SBW_WALLSID) do if (getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k]) then return true end end return false end function endsnowball() local score = {} if not SBW_USEWAIT then doRemoveItem(getTileItemById(SBW_TP, 1387).uid) end for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, SBW_INEVENT) > 0 then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)}) doPlayerSetStorageValue(pid, SBW_INEVENT, 0) doPlayerSetStorageValue(pid, SBW_SCORE, 0) doPlayerSetStorageValue(pid, SBW_AMMO, 0) doTeleportThing(pid, SBW_TPEND) end end table.sort(score, function(a, b) return a[2] > b[2] end) --local random_item = SBW_REWARDS[math.random(1, #SBW_REWARDS)] local hora = os.date("%X") local data = os.date("%x") if table.getn(score) > 0 then if SBW_ADDREWARD then for _, pid in ipairs(getPlayersOnline()) do if getCreatureName(pid) == score[1][1] then for op,ad in pairs(SBW_REWARDS) do doPlayerAddItem(pid, ad[1], ad[2]) end break end end end db.query("INSERT INTO `snowballwar` VALUES ('', ".. db.escapeString(score[1][1]) .. ",".. score[1][2] ..", ".. db.escapeString(data) ..", ".. db.escapeString(hora) ..");") db.query("UPDATE `players` SET `sbw_points`=`sbw_points`+".. score[1][2] .." WHERE `name` = " .. db.escapeString(score[1][1]) .. ";") doBroadcastMessage("[SNOWBALL EVENT] encerrou-se, parabens ao jogador "..score[1][1].." que venceu o SnowBall Event com "..score[1][2].." pontos.") end return true end local t_l = SBW_AREA[1] local b_r = SBW_AREA[2] function moveToEvent() for _, pid in ipairs(getPlayersOnline()) do if isInRange(getCreaturePosition(pid), SBW_WAITROOM[1], SBW_WAITROOM[2]) then local posti = {} local isPossibleToTeleportPlayer = false while (isPossibleToTeleportPlayer == FALSE) do posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7) if (isInWallArray(posti) == FALSE) then isPossibleToTeleportPlayer = TRUE end end doTeleportThing(pid, posti) doPlayerSetStorageValue(pid, SBW_INEVENT, 1) doPlayerSetStorageValue(pid, SBW_AMMO, SBW_MINAMMO) doPlayerSetStorageValue(pid, SBW_SCORE, 0) doPlayerSendTextMessage(pid, 27, "[SNOWBALL WAR] Seja bem vindo, aqui estao os comandos que voce vai usar durante o evento\n!snowball atirar --Atirar uma bola de neve.\n!snowball info --Isso mostra seus pontos de jogos e a quantia de bolas de neve que voce tem. Tambem mostra o ranking de pontos do evento.\n Recarregue suas bolas de neve clicando em frente ao gerador no centro do campo.\nAltamente recomendado adicionar estes comandos a sua hotkeys.") end end doRemoveItem(getTileItemById(SBW_TP, 1387).uid) addEvent(endsnowball, SBW_DURATION*1000*60) doBroadcastMessage(SBW_MSGSTART) end local time = os.date("*t") local timeopen1 = math.ceil(SBW_TIMEWAIT / 4) local timeopen2 = math.ceil(SBW_TIMEWAIT / 2) if (SBW_STARTAUTO) and (isInArray(SBW_DAYS,time.wday)) then doBroadcastMessage(SBW_MSGWARNING) if SBW_USEWAIT then addEvent(doBroadcastMessage, timeopen1*1000*60, "[SNOWBALL WAR] - Resta(m) ".. timeopen2 .." minuto(s) para iniciar o evento!") if (timeopen2 ~= timeopen1) then addEvent(doBroadcastMessage, timeopen2*1000*60, "[SNOWBALL WAR] - Resta(m) ".. timeopen1 .." minuto(s) para iniciar o evento!") end addEvent(moveToEvent, SBW_TIMEWAIT*1000*60) doCreateTeleport(1387, SBW_TPGO, SBW_TP) else if SBW_TFS == "0.3" then doItemSetAttribute(doCreateItem(1387, SBW_TP), "aid", 2880) else doSetItemActionId(doCreateItem(1387, SBW_TP), 2880) end if(SBW_DURATION > 0) then addEvent(endsnowball, SBW_DURATION*1000*60) end end end return true end  
       
       
       
       
      Em data/movements abra o seu movements.xml e insira a seguinte linha:
      <movevent type="StepIn" actionid ="2880" event="script" value="snowballmovement.lua"/>  
      Em data/movements/scripts crie um arquivo com o nome de snowballglobalmovement.lua e insira o seguinte conteúdo:
      function onStepIn(cid, item, pos) doTeleportThing(cid, SBW_TPGO) doBroadcastMessage("[SNOWBALL WAR] O " ..getCreatureName(cid).. " player esta participando do evento snowball.", MESSAGE_STATUS_CONSOLE_ORANGE) doPlayerSetStorageValue(cid, SBW_INEVENT, 1) doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO) doPlayerSetStorageValue(cid, SBW_SCORE, 0) end  
       
       
       
       
      Já estamos quase terminando!
      Agora em data/lib crie um arquivo com o nome de SBW.lua com o seguinte conteúdo:
       
      -- This script is part of Snow Ball War Event Tibiaking Absolute -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // -- POSIÇÕES IMPORTANTES SBW_AREA = {{x = 1214, y = 1205, z = 7}, {x = 1251, y = 1242, z = 7}}-- AREA DO EVENTO | Canto superior esquerdo / inferior direito SBW_WAITROOM = {{x = 1229, y = 1220, z = 6}, {x = 1235, y = 1226, z = 6}} -- AREA DE ESPERA | Canto superior esquerdo / inferior direito SBW_TP = {x = 165, y = 45, z = 7} -- local onde teleport sera criado (entrada de jogadores) SBW_TPGO = {x = 1232, y = 1223, z = 6} -- local onde teleport vai levar (saida de jogadores) SBW_TPEND = {x = 155, y = 54, z = 7} -- local onde serao teleport ao final do evento SBW_GERADOR = {x = 1232, y = 1223, z = 7} -- local onde gerador vai ficar -- CONFIGURAÇÕES DO EVENTO SBW_DAYS = {1,2,3,4,5,6,7} -- dias de semana que vai abrir SBW_DURATION = 10 -- duração do evento em minutos SBW_POINTSKILL = 1 -- pontos de jogo por morte SBW_AMMOBUY = 20 -- quantia de munições compradas por cada ponto SBW_MINAMMO = 50 -- munição inicial dos jogadores SBW_TIMEWAIT = 3 -- tempo na sala de espera em minutos SBW_AMMOINFI = false SBW_LOSTSCORE = true SBW_RANDOMIZE = true SBW_RESETAMMO = true SBW_STARTAUTO = true SBW_USEWAIT = true --PREMIO DO EVENTO SBW_ADDREWARD = true SBW_REWARDS = { {6527,500}, {2345,1} } -- // Não mexa daqui para baixo SBW_TFS = "0.4" -- STORAGES SBW_EXAUSTHED = 2455 SBW_INEVENT = 2460 SBW_SCORE = 2465 SBW_AMMO = 2400 SBW_WALLSID = {5324,7003,7021,6712,7023,7002,6713,6714,6869,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6707,6708,6709,6710,6711,2698,2697,7020,6719,6720,6721,6722,6723,6724,6725,6726,6727,6761,6762,6768,6769,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4664,4665,4666,7008,7009,7010,7011,8239,7004,7005,7006,7007,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,7022} SBW_BALLSPEED = 150 SBW_SHOOTEXAUSTHED = 1000 SBW_SHOOTDIR = 0 SBW_STATUS = 'on' -- MENSAGENS SBW_MSGWARNING = "[SNOWBALL WAR] Abriu o teleport de ingresso para o evento, para participar se dirija ate o templo do servidor." SBW_MSGSTART = "[SNOWBALL WAR] O teleport foi removido e o evento foi iniciado, boa sorte a todos participantes." A frente das configuração solicitadas explica onde devem ser modificados.
       
       
       
       
       
      E por fim, vá até o seu banco de dados (phpmyadmin) e insira a seguinte query:
      CREATE TABLE IF NOT EXISTS `snowballwar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `score` int(11) NOT NULL, `data` varchar(255) NOT NULL, `hora` varchar(255) NOT NULL, PRIMARY KEY (`id`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;  
      Ainda no phpmyadmin execute:
      ALTER TABLE `players` ADD `sbw_points` int(11);  
       
      Importe o arquivo SNOWBALL.otbm em seu mapa!
      Imagem do mapa:


      Download do mapa: https://www.sendspace.com/file/mae37z
      Scan do mapa: https://www.virustotal.com/pt/file/94a507c71ef4cc241e415f2a8290441f7fa77809d804e24be18e9581a85c4740/analysis/1479161634/
       
       


      É importante lembrar que peguei o script de um autor e realizei as modificações o tornando público para a comunidade exclusiva do TIBIAKING.

      Espero que façam um ótimo proveito.

      See you later.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo