Ir para conteúdo

Featured Replies

Postado

Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website).

Ex. TFS 1.3;

Base: naruto white

 

 

Qual erro está surgindo/O que você procura?

Estou ultilizando a seguinte script para teleport por alavanca 2 player para uma arena pvp onde o pvp tem limite de tempo de 5 minutos porém a alavanca não está funcionando alguem sabe o problema?? 

 

Data/actions/scripts

 

dofile('data/lib/arenapvp.lua')

function onUse(cid, item, toPosition, itemEx, fromPosition)

    local player1 = getTopCreature(arena.player1pos).uid
    local player2 = getTopCreature(arena.player2pos).uid

    if item.itemid == 1945 then
        doTransformItem(item.uid, item.itemid+1)
        if getGlobalStorageValue(arena.gstorage) < 1 then
            if isPlayer(player1) and isPlayer(player2) then
                doPlayerSendTextMessage(player1, MESSAGE_STATUS_WARNING, "Lutem!")
                   doPlayerSendTextMessage(player2, MESSAGE_STATUS_WARNING, "Lutem!")
                   doSendMagicEffect(getThingPos(player1), CONST_ME_POFF)
                   doSendMagicEffect(getThingPos(player2), CONST_ME_POFF)
                   setPlayerStorageValue(player1, arena.pstorage, 1)
                setPlayerStorageValue(player2, arena.pstorage, 1)
                doTeleportThing(player1, arena.nplayer1pos)
                doTeleportThing(player2, arena.nplayer2pos)
                setGlobalStorageValue(arena.gstorage, 1)
                addEvent(function ()
                    if getQuantidadePlayer(arena.toPos, arena.fromPos) > 0 then
                        doRemovePlayer(arena.toPos, arena.fromPos, arena.exitPos, arena.pstorage)
                        setGlobalStorageValue(arena.gstorage, -1)
                    end
                end, 1000*60*arena.time)
            else
                doCreatureSay(cid, "Precisa De Mais 1 Player Para entrar na Arena de Combate", TALKTYPE_ORANGE_1)
            end
        else
            doCreatureSay(cid, "Aguarde o Termino do Combate", TALKTYPE_ORANGE_1)
        end
    elseif item.itemid == 1946 then
        doTransformItem(item.uid, item.itemid-1)
    end

    return true
end

 

Data/actions.xml

 

<action actionid="30015" event="script" value="arenapvp.lua"/>

 

Data/creaturescripts/scripts

 

dofile('data/lib/arenapvp.lua')

function onStatsChange(cid, attacker, type, combat, value)
    
    if isPlayer(cid) and getPlayerStorageValue(cid, arena.pstorage) == 1 and type == STATSCHANGE_HEALTHLOSS then
        if value >= getCreatureHealth(cid) then
            local killer = attacker
            doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
            doCreatureAddMana(cid, getCreatureMaxMana(cid))
            doCreatureAddHealth(killer, getCreatureMaxHealth(killer))
            doCreatureAddMana(killer, getCreatureMaxMana(killer))
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "[Arena]: you lost the duel!")
            doPlayerSendTextMessage(killer, MESSAGE_STATUS_WARNING, "[Arena]: you win the duel!")
            doTeleportThing(cid, arena.exitPos)
            doTeleportThing(killer, arena.exitPos)
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
            doSendMagicEffect(getThingPos(killer), CONST_ME_POFF)
            setPlayerStorageValue(cid, arena.pstorage, -1)
            setPlayerStorageValue(killer, arena.pstorage, -1)
            setGlobalStorageValue(arena.gstorage, -1)
            return false
        end
    end
    return true
end

function onLogin(cid)

    registerCreatureEvent(cid, "ArenaPVP")

    return true        
end

 

Data/creaturescripts.xml

 

<event type="login" name="verf_PVP" event="script" value="arenapvp.lua"/>

 

Data/globalevents/scripts

 

function onThink(interval, lastExecution)

local total_players = 0
local storage = 24658 -- ALTERAR storage usado no sistema deixar todos iguais
local item_premio = 2160 -- ALTERAR item dado de premio, caso não queira dar item, coloque 2160
local item_quantidade_premio = 200 -- ALTERAR quantidade do item ganho, caso não queira dar item , coloque 0
local player_escolhido = 0
local players = getPlayersOnline()
local i = 1
local pos_templo = {x = 1042, y = 1125, z = 6} -- ALTERAR coordenada do templo do seu ot server

if getGlobalStorageValue(storage) == 1 then
else
return TRUE
end

while i <= #players do
local pos_player = getPlayerPosition(players)
local pos1_arena = {x = 1278, y = 1520, z = 4} -- ALTERAR pos do canto superior esquerdo da arena
local pos2_arena = {x = 1285, y = 1520, z = 4} -- ALTERAR pos do canto inferior direito da arena
if pos_player.x >= pos1_arena.x and pos_player.y >= pos1_arena.y and pos_player.x <= pos2_arena.x and pos_player.y <= pos2_arena.y then
total_players = total_players + 1
player_escolhido = players

end
i = i + 1
end

if total_players == 1 then
setGlobalStorageValue(storage, -1)
doTeleportThing(player_escolhido, pos_templo)
doPlayerAddItem(player_escolhido, item_premio, item_quantidade_premio)
doPlayerSendTextMessage(player_escolhido, MESSAGE_STATUS_CONSOLE_BLUE, "Você é o Vencedor do Evento.") -- ALTERAR frase para o vencedor do premio
doBroadcastMessage("O Player "..(getPlayerName(player_escolhido)).." é o Vencedor do Evento.",22) -- ALTERAR frase para todos, do ganhador do premio
return TRUE
else
if total_players <= 0 then
setGlobalStorageValue(storage, -1)
doBroadcastMessage("Todos os Jogadores Se mataram, fim do Evento.",22) -- ALTERAR frase para todos, do ganhador do premio
return TRUE
end
end

return TRUE
end

 

data/movements/scripts

 

function onStepIn(cid, item, position, fromPosition)


local config = {

msgDenied = "Arena PVP",

msgWelcome = "Seja Bem Vindo Arena Pvp."
}

local pos = {x = 1049, y = 1103, z = 7}

if getPlayerStorageValue(cid, 13322) - os.time() <= 0 then

doTeleportThing(cid, pos)

doPlayerPopupFYI(cid, config.msgDenied)

doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return TRUE
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgWelcome)
return TRUE
end

 

data/movements.xml

 

<movevent type="StepIn" uniqueid="1429" event="script" value="arenapvp.lua"/>

 

Você tem o código disponível? Se tiver publique-o aqui:

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.

Editado por cristiandimi (veja o histórico de edições)

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.1k
  • Posts 512.5k

Informação Importante

Confirmação de Termo