Postado Fevereiro 1, 2022 3 anos fiz esse código aqui, pra ficar mais fácil de adicionar mais cidades posteriormente, sem ter que mexer no "código", só adicionar na tabela mesmo local config = { cities = { ["thais"] = { name = "Thais City", pos = {x = 141, y = 379, z = 7} }, ["carlin"] = { name = "Carlin City", pos = {x = 142, y = 379, z = 7} }, ["venore"] = { name = "Venore City", pos = {x = 143, y = 379, z = 7} }, ["kazordoon"] = { name = "Kazordoon City", pos = {x = 144, y = 379, z = 7} }, ["yalahar"] = { name = "Yalahar City", pos = {x = 145, y = 379, z = 7} }, }, effect = 39 } function onSay(cid, words, param, channel) if (param == "") then return doPlayerSendCancel(cid, string.format("No parameters. Try this instead: %s cityname.", words)) end local cities = "" for city, values in pairs (config.cities) do cities = city .. ", " .. cities cities = cities:gsub(", $", ".") end if not config.cities[param] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("Available cities: %s", cities)) return doPlayerSendCancel(cid, "Invalid city. A list of available cities has been sent to you. Check your Default Channel.") end doTeleportThing(cid, config.cities[param].pos) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("You have been teleported to %s.", config.cities[param].name)) doSendMagicEffect(getPlayerPosition(cid), config.effect) return true end
Postado Fevereiro 1, 2022 3 anos 20 horas atrás, vff95 disse: Para servidores 12.x/TFS1.4 Só dei uma modificada no script do @Kyle Bellini conforme as funções para TFS 1.x 20 horas atrás, vff95 disse: um script para ADMs, GODs, GMs, ACCOUNT_TYPE_NORMAL = 1, ACCOUNT_TYPE_TUTOR = 2, ACCOUNT_TYPE_SENIORTUTOR = 3, ACCOUNT_TYPE_GAMEMASTER = 4, ACCOUNT_TYPE_COMMUNITYMANAGER = 5, ACCOUNT_TYPE_GOD = 6 local comandos = { ["thais"] = {name = "Thais City", pos = Position(141, 379, 7)}, ["carlin"] = {name = "Carlin City", pos = Position(142, 379, 7)}, ["venore"] = {name = "Venore City", pos = Position(143, 379, 7)}, ["kazordoon"] = {name = "Kazordoon City", pos = Position(144, 379, 7)}, ["yalahar"] = {name = "Yalahar City", pos = Position(144, 379, 7)}, } function onSay(player, words, param) if not player:getGroup():getAccess() then return true end --[[ ACCOUNT_TYPE_NORMAL = 1, ACCOUNT_TYPE_TUTOR = 2, ACCOUNT_TYPE_SENIORTUTOR = 3, ACCOUNT_TYPE_GAMEMASTER = 4, ACCOUNT_TYPE_COMMUNITYMANAGER = 5, ACCOUNT_TYPE_GOD = 6 ]]-- if player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then return false end local cities = "" for k, v in pairs(comandos) do cities[#cities + 1] = k end local posicao = comandos[string.lower(param)] then if param == "" or not posicao then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, #cities == 0 and "No have commands." or table.concat(cities, ', ')) player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end player:sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(posicao.pos) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("You have been teleported to %s.", posicao.name)) player:sendMagicEffect(CONST_ME_TELEPORT) return true end STYLLER OT 2022
Postado Fevereiro 2, 2022 3 anos opa, não havia notado que era pra 1.x hahaha bom que já fica aí pra quem usa 0.x valeu Luan o/
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.