Postado Fevereiro 22, 2020 5 anos Eae galera!! Tem uma quest em meu servidor, similar a anihi, que preciso por tempo no uso da alavanca pois está entrando mais de um time por vez, se possível por a contagem na alavanca e uma mensagem no chat. Ainda sou leigo no assunto se alguém poder me ajudar fico muito agradecido. desde já, OBRIGADO. Segue abaixo a action script. Citar local level = 130 local redo = {status = false, storageValue = 61111} -- true para ilimitado, false para somente uma vez local config = { { vocations = {3, 7}, playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {2, 6}, playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {1, 5}, playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {4, 8}, playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, --Position of the reward room. } } 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." } function onUse(cid, fromPosition, 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 for i = 1, #players do local p = players if not redo.status then end doSendMagicEffect(getPlayerPosition(p.player), CONST_ME_POFF) doTeleportThing(p.player, p.newPos) doSendMagicEffect(p.newPos, CONST_ME_TELEPORT) end return true end
Postado Fevereiro 22, 2020 5 anos Tente assim Edita as posições de acorda com a sala q quer verificar os players local level = 130 local redo = {status = false, storageValue = 61111} -- true para ilimitado, false para somente uma vez local posi = {x=xxxx, y=yyyy, z=z} -- posição topo esquerdo da sala local posf = {x=xxxx, y=yyyy, z=z} -- posição parte inferior esquerda da sala local pos = getCreaturePosition(cid) local config = { { vocations = {3, 7}, playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {2, 6}, playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {1, 5}, playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {4, 8}, playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, --Position of the reward room. } } 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] = "Já existe players na quest. Aguardem." } function onUse(cid, fromPosition, 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 isInArea(pos, posi, posf) and isPlayer(cid) == true then msgID = 5 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 for i = 1, #players do local p = players if not redo.status then end doSendMagicEffect(getPlayerPosition(p.player), CONST_ME_POFF) doTeleportThing(p.player, p.newPos) doSendMagicEffect(p.newPos, CONST_ME_TELEPORT) end return true end Editado Fevereiro 22, 2020 5 anos por Naze bugs no codigo (veja o histórico de edições) Discord: Naze#3578 Ter Linux Dentro de Windows com Acesso 'localhost' para testes e + AutoLoot Otimizado Direto na Source (tfs 0.4/otx) // Pirataria é crime, original é roubo, compartilhar é legal.
Postado Fevereiro 23, 2020 5 anos Autor @Naze Bom dia! Deu o seguinte erro: Citar [23/02/2020 09:19:54] [Error - Action Interface] [23/02/2020 09:19:54] data/actions/scripts/quest/rodquest.lua [23/02/2020 09:19:54] Description: [23/02/2020 09:19:54] (luaGetThingPosition) Thing not found [23/02/2020 09:19:54] Reloaded actions. O servidor é 8.6 TFS 0.4
Postado Fevereiro 23, 2020 5 anos Mudei a função tente agora. local level = 130 local redo = {status = false, storageValue = 61111} -- true para ilimitado, false para somente uma vez local posi = {x=xxxx, y=yyyy, z=z} -- posição topo esquerdo da sala local posf = {x=xxxx, y=yyyy, z=z} -- posição parte inferior esquerda da sala local function getPlayersInRange(pos1, pos2) local creaturesList = {} for px = pos1.x, pos2.x do for py = pos1.y, pos2.y do if not (x == 0 and y == 0) then local creature = getTopCreature({x = px, y = py, z = pos1.z}) if creature.type == 1 then table.insert(creaturesList, creature.uid) end end end end return creaturesList end local config = { { vocations = {3, 7}, playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {2, 6}, playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {1, 5}, playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, -- Position of the reward room. }, { vocations = {4, 8}, playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile newPos = {x=1114, y=1142, z=8}, --Position of the reward room. } } 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] = "Já existe players na quest. Aguardem." } function onUse(cid, fromPosition, 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 #getPlayersInRange(posi, posf) >= 1 then msgID = 5 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 for i = 1, #players do local p = players if not redo.status then end doSendMagicEffect(getPlayerPosition(p.player), CONST_ME_POFF) doTeleportThing(p.player, p.newPos) doSendMagicEffect(p.newPos, CONST_ME_TELEPORT) end return true end Discord: Naze#3578 Ter Linux Dentro de Windows com Acesso 'localhost' para testes e + AutoLoot Otimizado Direto na Source (tfs 0.4/otx) // Pirataria é crime, original é roubo, compartilhar é legal.
Postado Fevereiro 24, 2020 5 anos Autor @Naze Eea. Deu o seguinte erro: Citar [23/02/2020 21:46:01] [Error - Action Interface] [23/02/2020 21:46:01] data/actions/scripts/quest/rodquest.lua:onUse [23/02/2020 21:46:01] Description: [23/02/2020 21:46:01] attempt to index a nil value [23/02/2020 21:46:01] stack traceback: [23/02/2020 21:46:01] [C]: in function 'doTeleportThing' [23/02/2020 21:46:02] data/actions/scripts/quest/rodquest.lua:92: in function <data/actions/scripts/quest/rodquest.lua:55> Mano, eu estava pensando aqui em por só tempo de exhausted na alavanca, é mais uma gambiarra, porque ao rastrear o quadrado ela pega quem ta na city. A quest tem dois andares. Sacou? Se quiser deixar isso para depois do carnaval não tem problema.
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.