Postado Dezembro 27, 2017 7 anos Existe uma maneira de limitar para que por exemplo o GM FULANO DE TAL, não possa dar /goto GM FULANINHO Comando /goto function onSay(cid, words, param) local player = Player(cid) if getPlayerGroupId(cid) > 3 then local target = Creature(param) if target == nil then player:sendCancelMessage("Creature not found.") return false end player:teleportTo(target:getPosition()) return false end end Comando /c function onSay(player, words, param) if not player:getGroup():getAccess() then return true end local creature = Creature(param) if not creature then player:sendCancelMessage("A creature with that name could not be found.") return false end local oldPosition = creature:getPosition() local newPosition = creature:getClosestFreePosition(player:getPosition(), false) if newPosition.x == 0 then player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".") return false elseif creature:teleportTo(newPosition) then if not creature:isInGhostMode() then oldPosition:sendMagicEffect(CONST_ME_POFF) newPosition:sendMagicEffect(CONST_ME_TELEPORT) end end return false end
Postado Dezembro 28, 2017 7 anos @SouDeus Mano Se for dar umas respostas dessa e melhor ficar queto não acha ? @Andreeyyy Testei não mano adicionei a função de vem quais são as restrições Bom aproveito! /goto function onSay(cid, words, param) local restricao = {"Demon","Fire Devil"} if param == "restricao" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, restricao[r]") return true end for r = 1, #restricao do if param == restricao[r]then local player = Player(cid) if getPlayerGroupId(cid) > 3 then local target = Creature(param) if target == nil then player:sendCancelMessage("Creature not found.") return false end player:teleportTo(target:getPosition()) return false end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar isto diga /goto restricao") end end /c function onSay(player, words, param) local restricao = {"Demon","Fire Devil"} if param == "restricao" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, restricao[r]") return true end for r = 1, #restricao do if param == restricao[r]then if not player:getGroup():getAccess() then return true end local creature = Creature(param) if not creature then player:sendCancelMessage("A creature with that name could not be found.") return false end local oldPosition = creature:getPosition() local newPosition = creature:getClosestFreePosition(player:getPosition(), false) if newPosition.x == 0 then player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".") return false elseif creature:teleportTo(newPosition) then if not creature:isInGhostMode() then oldPosition:sendMagicEffect(CONST_ME_POFF) newPosition:sendMagicEffect(CONST_ME_TELEPORT) end end return false end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar isto diga /c restricao") end end Editado Dezembro 28, 2017 7 anos por Ckfox (veja o histórico de edições) Ajudei? REP+ Meus Servers: PokeUnwind Em Breve Rust Tibia Fechado Tópicos: [Tutorial] Adicionando Pokemons com icon system [Solução] ElfBot não abre corpos Projetos: DigiTibia Fechado Rust Tibia Fechado(temporariamente!)
Postado Dezembro 28, 2017 7 anos Autor 6 horas atrás, Ckfox disse: @SouDeus Mano Se for dar umas respostas dessa e melhor ficar queto não acha ? @Andreeyyy Testei não mano adicionei a função de vem quais são as restrições Bom aproveito! /goto function onSay(cid, words, param) local restricao = {"Demon","Fire Devil"} if param == "restricao" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, restricao[r]") return true end for r = 1, #restricao do if param == restricao[r]then local player = Player(cid) if getPlayerGroupId(cid) > 3 then local target = Creature(param) if target == nil then player:sendCancelMessage("Creature not found.") return false end player:teleportTo(target:getPosition()) return false end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar isto diga /goto restricao") end end /c function onSay(player, words, param) local restricao = {"Demon","Fire Devil"} if param == "restricao" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, restricao[r]") return true end for r = 1, #restricao do if param == restricao[r]then if not player:getGroup():getAccess() then return true end local creature = Creature(param) if not creature then player:sendCancelMessage("A creature with that name could not be found.") return false end local oldPosition = creature:getPosition() local newPosition = creature:getClosestFreePosition(player:getPosition(), false) if newPosition.x == 0 then player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".") return false elseif creature:teleportTo(newPosition) then if not creature:isInGhostMode() then oldPosition:sendMagicEffect(CONST_ME_POFF) newPosition:sendMagicEffect(CONST_ME_TELEPORT) end end return false end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar isto diga /c restricao") end end [Warning - Event::checkScript] Can not load script: scripts/teleport_to_creature.lua data/talkactions/scripts/teleport_to_creature.lua:19: 'then' expected near 'doPlayerSendTextMessage' TFS 1.2 - OTX
Postado Dezembro 28, 2017 7 anos @Andreeyyy function onSay(cid, words, param) local restricao = {"Demon","Fire Devil"} if param == "restricao" player:sendCancelMessage(restricao[r]) return true end for r = 1, #restricao do if param == restricao[r]then local player = Player(cid) if getPlayerGroupId(cid) > 3 then local target = Creature(param) if target == nil then player:sendCancelMessage("Creature not found.") return false end player:teleportTo(target:getPosition()) return false end end player:sendCancelMessage("Você não pode usar isto diga /goto restricao") end end ---------------------------------------------------------------------------------------- function onSay(player, words, param) local restricao = {"Demon","Fire Devil"} if param == "restricao" player:sendCancelMessage(restricao[r]) return true end for r = 1, #restricao do if param == restricao[r]then if not player:getGroup():getAccess() then return true end local creature = Creature(param) if not creature then player:sendCancelMessage("A creature with that name could not be found.") return false end local oldPosition = creature:getPosition() local newPosition = creature:getClosestFreePosition(player:getPosition(), false) if newPosition.x == 0 then player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".") return false elseif creature:teleportTo(newPosition) then if not creature:isInGhostMode() then oldPosition:sendMagicEffect(CONST_ME_POFF) newPosition:sendMagicEffect(CONST_ME_TELEPORT) end end return false end player:sendCancelMessage("Você não pode usar isto diga /c restricao") end end Ajudei? REP+ Meus Servers: PokeUnwind Em Breve Rust Tibia Fechado Tópicos: [Tutorial] Adicionando Pokemons com icon system [Solução] ElfBot não abre corpos Projetos: DigiTibia Fechado Rust Tibia Fechado(temporariamente!)
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.