Ir para conteúdo
  • Cadastre-se

(Resolvido)[Ajuda] Desert Quest Bugada


Ir para solução Resolvido por Dwarfer,

Posts Recomendados

Eaew galera do TK!

To com um problema na seguinte script

Citar

 local config = {
    -- level needed to make the quest
    level = 130,
 
    -- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
    redo = {
        status = true, -- true = unlimited, false = once
        storageValue = 61111 -- only if status is false this will be used
    },
 
    -- vocation requirement, positions and item configuration
    {
        vocations = {1, 5},
        itemId = 2190,
        playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1117, y=1151, z=6}  -- Position of Spellbook "Sorcerer".
    },
 
    {
        vocations = {2, 6},
        itemId = 2182,
        playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1122, y=1157, z=6} -- Position of Red apple "Druid".
    },
 
    {
        vocations = {3, 7},
        itemId = 2399,
        playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1127, y=1154, z=6} -- Position of Crossbow "Paladin".
    },
 
    {
        vocations = {4, 8},
        itemId = 8602,
        playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, --Position of the reward room.
        itemPos = {x=1122, y=1147, z=6} --Position of Sword "Knight".
    }
}
 
function onUse(cid)
    local players = {}
    for _, v in ipairs(config) do
 
        v.playerPos.stackpos = 253
        local player = getThingfromPos(v.playerPos).uid
 
        if isPlayer(player) == FALSE then
            return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Não há jogadores suficiente.")
        elseif getPlayerLevel(player) < config.level then
            players.level = true
        elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
            players.vocation = true
        elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) ~= TRUE then
            players.done = true
        else
            v.itemPos.stackpos = 1
            local item = getThingfromPos(v.itemPos)
 
            if item.itemid ~= v.itemId then
                players.item = true
            else
                table.insert(players, player)
            end
        end
    end
 
    if players.level then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem ser level " .. config.level .. " ou mais.")
    elseif players.vocation then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem estar em seus respectivo piso!")
    elseif players.done then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Um jogador em seu time ja fez a Fishing Rod and Pick Quest!")
    elseif players.item then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os items devem estar na posição correta!")
    else
        for k, player in ipairs(players) do
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
            doTeleportThing(player, config[k].newPos)
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
        end
    end
 
    return TRUE
end

 QUando um time tenta fazer a quest  (time que nunca fez) fala que alguem do time ja fez. Sacou?

Citar

if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
    redo = {
        status = true, -- true = unlimited, false = once
        storageValue = 61111 -- only if status is false this will be used

se eu mudar de true pra falser na tag acima /\ podera ser feita varias vezes, mas quero que possa ser feita apenas umas vez só!

@luangop

 

CREDITO DA SCRIPT: Tovar-OtLand

@koete

Ai amigo, tenta me ajudar nessa script ai?, mt obg !!

os players mesmo que nunca fizeram a quest não podem entrar nela, fala que ja fizeram a quest :( sendo que nunca fizeram. pfv tenta me ajudar ai, vlw +REP.

Link para o post
Compartilhar em outros sites

(storageValue = 61111)

 

storageValue serve para gravar um número pra sempre em um player, tipo uma marca. no caso quando algum jogador ja tem essa numeração o script retorna para falso e manda a mensagem que tem alguem com essa numeração. Deve ter outra quest no seu server que da a mesma storagevalue. Mude a numeração para qualquer outra coloca uns 8543126 sei la e testa. 

Link para o post
Compartilhar em outros sites

Vou tentar aqui, qual quer coisa solicito vc aqui de novo, blza? já volto.

@koete

Não deu certo, coloquei uma storage qual quer e continuo dando errado, fica dando essa msg \/ e ngm toma teleport pra dentro da quest

 

21:07 Um jogador em seu time ja fez a Fishing Rod and Pick Quest!

 

Sendo que ngm nunca fez a quest que esta no time, criei os chares td de novo e assim mesmo dá esse error. :(

@luangop

Tenta me ajudar nessa script?

Até agora não consegui arrumar :(

Vlw tmj 

 

+REP

Link para o post
Compartilhar em outros sites

Teste assim:

 local config = {
    -- level needed to make the quest
    level = 130,
 
    -- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
    redo = {
        status = true, -- true = unlimited, false = once
        storageValue = 61111 -- only if status is false this will be used
    },
 
    -- vocation requirement, positions and item configuration
    {
        vocations = {1, 5},
        itemId = 2190,
        playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1117, y=1151, z=6}  -- Position of Spellbook "Sorcerer".
    },
 
    {
        vocations = {2, 6},
        itemId = 2182,
        playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1122, y=1157, z=6} -- Position of Red apple "Druid".
    },
 
    {
        vocations = {3, 7},
        itemId = 2399,
        playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1127, y=1154, z=6} -- Position of Crossbow "Paladin".
    },
 
    {
        vocations = {4, 8},
        itemId = 8602,
        playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, --Position of the reward room.
        itemPos = {x=1122, y=1147, z=6} --Position of Sword "Knight".
    }
}
 
function onUse(cid)
    local players = {}
    for _, v in ipairs(config) do
 
        v.playerPos.stackpos = 253
        local player = getThingfromPos(v.playerPos).uid
 
        if isPlayer(player) == FALSE then
            return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Não há jogadores suficiente.")
        elseif getPlayerLevel(player) < config.level then
            players.level = true
        elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
            players.vocation = true
        elseif config.redo.status and getPlayerStorageValue(player, config.redo.storageValue) ~= TRUE then
            players.done = true
        else
            v.itemPos.stackpos = 1
            local item = getThingfromPos(v.itemPos)
 
            if item.itemid ~= v.itemId then
                players.item = true
            else
                table.insert(players, player)
            end
        end
    end
 
    if players.level then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem ser level " .. config.level .. " ou mais.")
    elseif players.vocation then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem estar em seus respectivo piso!")
    elseif players.done then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Um jogador em seu time ja fez a Fishing Rod and Pick Quest!")
    elseif players.item then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os items devem estar na posição correta!")
    else
        for k, player in ipairs(players) do
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
            doTeleportThing(player, config[k].newPos)
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
        end
    end
 
    return TRUE
end

 

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Link para o post
Compartilhar em outros sites

@luangop

Continua o mesmo error, criei 4 chars de cada vocação e coloquei tudo certo e fala a mesma coisa \/

13:13 Um jogador em seu time ja fez a Fishing Rod and Pick Quest!

Sendo que nenhum deles fizeram a quest, nunca fizeram. :(

Link para o post
Compartilhar em outros sites

@Joaoafp 

local config = {
    -- level needed to make the quest
    level = 130,
 
    -- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
    redo = {
        status = false, -- true = unlimited, false = once
        storageValue = 61111 -- only if status is false this will be used
    },
 
    -- vocation requirement, positions and item configuration
    {
        vocations = {1, 5},
        itemId = 2190,
        playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1117, y=1151, z=6}  -- Position of Spellbook "Sorcerer".
    },
 
    {
        vocations = {2, 6},
        itemId = 2182,
        playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1122, y=1157, z=6} -- Position of Red apple "Druid".
    },
 
    {
        vocations = {3, 7},
        itemId = 2399,
        playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1127, y=1154, z=6} -- Position of Crossbow "Paladin".
    },
 
    {
        vocations = {4, 8},
        itemId = 8602,
        playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, --Position of the reward room.
        itemPos = {x=1122, y=1147, z=6} --Position of Sword "Knight".
    }
}
 
function onUse(cid)
    local players = {}
    for _, v in ipairs(config) do
 
        v.playerPos.stackpos = 253
        local player = getThingfromPos(v.playerPos).uid
 
        if isPlayer(player) == FALSE then
            return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Não há jogadores suficiente.")
        elseif getPlayerLevel(player) < config.level then
            players.level = true
        elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
            players.vocation = true
        elseif config.redo.status == false and getPlayerStorageValue(cid, config.redo.storageValue) == 1 then
            players.done = true
        else
            v.itemPos.stackpos = 1
            local item = getThingfromPos(v.itemPos)
 
            if item.itemid ~= v.itemId then
                players.item = true
            else
                table.insert(players, player)
            end
        end
    end
 
    if players.level then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem ser level " .. config.level .. " ou mais.")
    elseif players.vocation then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem estar em seus respectivo piso!")
    elseif players.done then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Um jogador em seu time ja fez a Fishing Rod and Pick Quest!")
    elseif players.item then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os items devem estar na posição correta!")
    else
        for k, player in ipairs(players) do
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
            doTeleportThing(player, config[k].newPos)
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
        end
    end
 
    return TRUE
end 

Deixe false que é para que só possa fazer 1x vez.

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

@KotZletY

Deu errado, quando coloca false os jogadores podem fazer quantas vezes quiser :(

mas obg pela ajuda !

 

 

@xWhiteWolf

Wolf tenta me ajudar nessa ai? pfv? +REP

Link para o post
Compartilhar em outros sites
33 minutos atrás, Joaoafp disse:

quando coloca false os jogadores podem fazer quantas vezes quiser

Ué ? A descrição do script diz que se tiver falso só faz uma vez(once) e se tiver true que pode fazer várias vezes(unlimited).

 

Spoiler

local config = {
    -- level needed to make the quest
    level = 130,
 
    -- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
    redo = {
        status = false, -- true = unlimited, false = once
        storageValue = 61111 -- only if status is false this will be used
    },
 
    -- vocation requirement, positions and item configuration
    {
        vocations = {1, 5},
        itemId = 2190,
        playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1117, y=1151, z=6}  -- Position of Spellbook "Sorcerer".
    },
 
    {
        vocations = {2, 6},
        itemId = 2182,
        playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1122, y=1157, z=6} -- Position of Red apple "Druid".
    },
 
    {
        vocations = {3, 7},
        itemId = 2399,
        playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1127, y=1154, z=6} -- Position of Crossbow "Paladin".
    },
 
    {
        vocations = {4, 8},
        itemId = 8602,
        playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, --Position of the reward room.
        itemPos = {x=1122, y=1147, z=6} --Position of Sword "Knight".
    }
}
 
function onUse(cid)
    local players = {}
    for _, v in ipairs(config) do
 
        v.playerPos.stackpos = 253
        local player = getThingfromPos(v.playerPos).uid
 
        if isPlayer(player) == FALSE then
            return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Não há jogadores suficiente.")
        elseif getPlayerLevel(player) < config.level then
            players.level = true
        elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
            players.vocation = true
        elseif config.redo.status == false and getPlayerStorageValue(player, config.redo.storageValue) == 1 then
            players.done = true
        else
            v.itemPos.stackpos = 1
            local item = getThingfromPos(v.itemPos)
 
            if item.itemid ~= v.itemId then
                players.item = true
            else
                table.insert(players, player)
            end
        end
    end
 
    if players.level then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem ser level " .. config.level .. " ou mais.")
    elseif players.vocation then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem estar em seus respectivo piso!")
    elseif players.done then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Um jogador em seu time ja fez a Fishing Rod and Pick Quest!")
    elseif players.item then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os items devem estar na posição correta!")
    else
        for k, player in ipairs(players) do
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
            doTeleportThing(player, config[k].newPos)
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
        end
    end
 
    return TRUE
end 

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

@KotZletY

Eu sei manow, mas esta errada a descrição, não consigo resolver esse problema de jeito nenhum :(

crio os 4 chares e coloco td lá, e ja fala qe eles fizeram, mesmo o time quem nunca fez.

:'(

Link para o post
Compartilhar em outros sites

@Joaoafp 

 

Spoiler

 local config = {
    -- level needed to make the quest
    level = 130,
 
    -- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
    redo = {
        status = true, -- true = unlimited, false = once
        storageValue = 61111 -- only if status is false this will be used
    },
 
    -- vocation requirement, positions and item configuration
    {
        vocations = {1, 5},
        itemId = 2190,
        playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1117, y=1151, z=6}  -- Position of Spellbook "Sorcerer".
    },
 
    {
        vocations = {2, 6},
        itemId = 2182,
        playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1122, y=1157, z=6} -- Position of Red apple "Druid".
    },
 
    {
        vocations = {3, 7},
        itemId = 2399,
        playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1127, y=1154, z=6} -- Position of Crossbow "Paladin".
    },
 
    {
        vocations = {4, 8},
        itemId = 8602,
        playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, --Position of the reward room.
        itemPos = {x=1122, y=1147, z=6} --Position of Sword "Knight".
    }
}


function onUse(cid)
    local players = {}
    for _, v in ipairs(config) do
 
        v.playerPos.stackpos = 253
        local player = getThingfromPos(v.playerPos).uid
 
        if isPlayer(player) == FALSE then
            return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Não há jogadores suficiente.")
        elseif getPlayerLevel(player) < config.level then
            players.level = true
        elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
            players.vocation = true
        elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) >= 0 then
            players.done = true
        else
            v.itemPos.stackpos = 1
            local item = getThingfromPos(v.itemPos)
 
            if item.itemid ~= v.itemId then
                players.item = true
            else
                table.insert(players, player)
            end
        end
    end
 
    if players.level then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem ser level " .. config.level .. " ou mais.")
    elseif players.vocation then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os jogadores devem estar em seus respectivo piso!")
    elseif players.done then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Um jogador em seu time ja fez a Fishing Rod and Pick Quest!")
    elseif players.item then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Todos os items devem estar na posição correta!")
    else
        for k, player in ipairs(players) do
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
            doTeleportThing(player, config[k].newPos)
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
        end
    end
 
    return TRUE
end

 

 

Link para o post
Compartilhar em outros sites

@antharaz

Não Funcionou :( 

Todos jogadores que ja fizeram esta podendo fazer de novo, eles tinha que apenas fazer uma vez e se tentar fazer de novo ia aparecer escrito \/

Um jogador em seu time ja fez a Fishing Rod and Pick Quest!

 

Vou postar uma foto mostrando \/

Citar

 

Bola Preta > aonde fica o Knight

Bola Vermelha > Sorcerer

Bola Azul > Druid

Bola Amarelo > Pally

A Seta Roxa > Aonde os players vai ser teletransportado.

DESERT QUEST1.png

Link para o post
Compartilhar em outros sites
  • Solução

@Joaoafp

 

Spoiler

local level = 130
local redo = {status = false, storageValue = 61111} -- true para ilimitado, false para somente uma vez
 
local config = {
    {
        vocations = {1, 5},
        itemId = 2190,
        playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1117, y=1151, z=6}  -- Position of Spellbook "Sorcerer".
    },
 
    {
        vocations = {2, 6},
        itemId = 2182,
        playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1122, y=1157, z=6} -- Position of Red apple "Druid".
    },
 
    {
        vocations = {3, 7},
        itemId = 2399,
        playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1127, y=1154, z=6} -- Position of Crossbow "Paladin".
    },
 
    {
        vocations = {4, 8},
        itemId = 8602,
        playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, --Position of the reward room.
        itemPos = {x=1122, y=1147, z=6} --Position of Sword "Knight".
    }
}

local msgs = {
[1] = "Todos os jogadores devem estar em seus respectivos pisos!",
[2] = "Todos os players devem ser level " .. level .. " ou maior.",
[3] = "Um jogador em seu time ja fez a Fishing Rod and Pick Quest!",
[4] = "Não há jogadores suficientes.",
[5] = "Todos os items devem estar nas posições corretas!"
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local players, msgID = {}, 0
    for i, v in pairs(config) do
        local player = getTopCreature(v.playerPos).uid
        if player ~= 0 and isPlayer(player) then
            if not isInArray(v.vocations, getPlayerVocation(player)) then
                msgID = 1
                break
            elseif getPlayerLevel(player) < level then
                msgID = 2
                break
            elseif not redo.status then
                if getPlayerStorageValue(player, redo.storageValue) ~= -1 then
                    msgID = 3
                    break
                end
            end
            table.insert(players, {player = player, newPos = v.newPos})
        end    
    end
    if msgID ~= 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, msgs[msgID]) 
        return true
    end    
    if #players ~= #config then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, msgs[4]) 
        return true
    end
    if #config ~= getItemsInPos() then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, msgs[5]) 
        return true
    end
    
    for i = 1, #players do
        local p = players[i]
        if not redo.status then
            setPlayerStorageValue(p.player, redo.storageValue, 1)
        end
        doSendMagicEffect(getPlayerPosition(p.player), CONST_ME_POFF)
        doTeleportThing(p.player, p.newPos)
        doSendMagicEffect(p.newPos, CONST_ME_TELEPORT)
    end
    doRemoveItensInPos()
    return true
end

function getItemsInPos()
local check = {}
for i, v in pairs(config) do
    for i = 0, 255 do
        v.itemPos.stackpos = i
        tile = getTileItemById(v.itemPos, v.itemId)
    end
    if tile.uid > 0 then
        table.insert(check, 1)
    end
end
return #check
end

function doRemoveItensInPos()
for k, v in pairs(config) do
doCleanTile(v.itemPos)
end
end

 

 

Contato:

 

Link para o post
Compartilhar em outros sites

@Dwarfer

Vou testar aqui e te mando a resposta. Ja volto.

@Dwarfer

Valeuu !!, muito obrigado, pegou super bem e melhor que antes rs,

Posso te marcar nos tópicos que eu for criando? que eu precise de ajuda?

Muito obrigado msm. vlw

+REP

Tópico RESOLVIDO!

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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo