Postado Fevereiro 14, 2016 9 anos estou usando tfs 0.4 rev 3777, porem desde que mudei de mapa, o seguinte erro ocorre quando digito /t com o admin [Error - TalkAction Interface] data/talkactions/scripts/teleporttown.lua:onSay Description:[14/2/2016 18:12:52] data/talkactions/scripts/teleporttown.lua:38: attempt to concatenate field '?' (a nil value) stack traceback: data/talkactions/scripts/teleporttown.lua:38: in function <data/talkactions/scripts/teleporttown.lua:1> o script ta assim function onSay(cid, words, param, channel) local master = false if(words == '/t') then master = true elseif(param == '') then local str = "" for i, town in ipairs(getTownList()) do str = str .. town.name .. "\n" end doShowTextDialog(cid, 2160, str) return true end local tid, t = cid, string.explode(param, ",") if(t[(master and 1 or 2)]) then tid = getPlayerByNameWildcard(t[(master and 1 or 2)]) if(not tid or (isPlayerGhost(tid) and getPlayerAccess(tid) > getPlayerAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[(master and 1 or 2)] .. " not found.") return true end end local tmp = getPlayerTown(cid) if(not master) then tmp = t[1] if(not tonumber(tmp)) then tmp = getTownId(tmp) if(not tmp) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Town " .. t[1] .. " does not exists.") return true end end end local pos = getTownTemplePosition(tmp, false) if(type(pos) ~= 'table' or isInArray({pos.x, pos.y}, 0)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Town " .. t[1] .. " does not exists or has invalid temple position.") return true end pos = getClosestFreeTile(tid, pos) if(type(pos) ~= 'table' or isInArray({pos.x, pos.y}, 0)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.") return true end tmp = getCreaturePosition(tid) if(doTeleportThing(tid, pos) and not isPlayerGhost(tid)) then doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(pos, CONST_ME_TELEPORT) end return true end quando eu digito /town, aparece a lista das cidades que eu editei no map editor, quando os players são criados/morrem também funciona normalmente, mais o /t retorna erro no console e não teleporta quando digito /town <nome da cidade> também da como cidade não encontrada a unica coisa que alterei no servidor foi o mapa Editado Fevereiro 14, 2016 9 anos por Paulix (veja o histórico de edições)
Postado Fevereiro 15, 2016 9 anos Eu criei esse script de teleport para meu serve, usa ele: Citar -- [[ Marcryzius ]] function onSay(cid, words, param, channel) local MSG = MESSAGE_STATUS_CONSOLE_BLUE local sep = string.explode(param, ",") local god = cid local cid = cid local pos = nil if(words == "/goto" and isCreature(getCreatureByName(sep[1])))then if not(sep[1])then return true,doPlayerSendTextMessage(god, MSG, "/goto player, toplayer") end cid = not(sep[2]) and cid or getCreatureByName(sep[1]) pos = not(sep[2]) and getCreaturePosition(getCreatureByName(sep[1])) or getCreaturePosition(getCreatureByName(sep[2])) elseif(words == "/tp" and sep[1] and sep[2] and sep[3])then if not(sep[3])then return true,doPlayerSendTextMessage(god, MSG, "/tp player(opcional, caso seja voce mesmo nao precisa por o nome),x,y,z") end cid = not(tonumber(sep[1])) and getCreatureByName(sep[1]) or cid pos = not(tonumber(sep[1])) and {x = sep[2], y = sep[3], z = sep[4]} or {x = sep[1], y = sep[2], z = sep[3]} elseif(words == "/town")then if(getTownId(sep[1]) or getTownId(sep[2]))then cid = not(isPlayer(getCreatureByName(sep[1]))) and cid or getCreatureByName(sep[1]) pos = not(getTownId(sep[1]) or getTownId(sep[2])) and getTownTemplePosition(getPlayerTown(cid)) or getTownTemplePosition(getTownId(sep[1]) or getTownId(sep[2])) elseif(tonumber(sep[1]) or tonumber(sep[2]))then cid = not(isPlayer(sep[1])) and cid or getCreatureByName(sep[1]) pos = getTownTemplePosition((tonumber(sep[1])) and sep[1] or (tonumber(sep[2])) and sep[2] or getPlayerTown(cid)) else cid = not(isPlayer(getCreatureByName(sep[1]))) and cid or getCreatureByName(sep[1]) pos = getTownTemplePosition(getPlayerTown(cid)) end elseif(words == "/a")then cid = tonumber(sep[1]) and cid or getCreatureByName(sep[1]) pos = getPosByDir(getCreaturePosition(cid), getPlayerLookDirection(cid), param:match("%d+") or 1) elseif(words == "/up" or words == "/down")then if(isPlayer(getCreatureByName(sep[1])))then local z = (words == "/up") and -tonumber(sep[2]) or tonumber(sep[2]) cid = getCreatureByName(sep[1]) pos = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y, z = getCreaturePosition(cid).z+z} else local n = tonumber(param) or 1 local z = (words == "/up") and -n or n pos = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y, z = getCreaturePosition(cid).z+tonumber(z)} end end if(type(pos) == "table" and pos.x and pos.y and pos.z)then if(getClosestFreeTile(cid,pos,false,false))then doTeleportThing(cid, pos, true);doSendMagicEffect(getCreaturePosition(god), CONST_ME_POFF);doSendMagicEffect(pos, CONST_ME_TELEPORT) else doPlayerSendTextMessage(god, MSG, "Destino n�o encontrado.");doSendMagicEffect(getCreaturePosition(god), CONST_ME_POFF) end else doPlayerSendTextMessage(god, MSG, "Destino invalido.");doSendMagicEffect(getCreaturePosition(god), CONST_ME_POFF) end return true end
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.