Postado Agosto 13, 2015 9 anos Solução Em 13/08/2015 em 03:13, danbsten disse: 00:12 /town 7 00:12 Player 7 not found. 00:12 /town 5 00:12 Player 5 not found. E não teria como ser por nome da city (se funciona-se) n? Deixa seu teleporttown.lua assim: function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local tid = cid local t = string.explode(param, ",") if(t[2]) then tid = getPlayerByNameWildcard(t[2]) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.") return true end end local 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 local pos = getTownTemplePosition(tmp, false) if(not pos 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(not pos 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, true) and not isPlayerGhost(tid)) then doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(pos, CONST_ME_TELEPORT) end return true end <talkaction log="yes" words="/town" access="2" event="script" value="teleporttown.lua"/> E deixe seu teleportmaster.lua assim: function onSay(cid, words, param, channel) local tid = cid if(param ~= '') then tid = getPlayerByNameWildcard(param) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end end local pos = getPlayerTown(tid) local tmp = getTownName(pos) if(not tmp) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Home town does not exists.") return true end pos = getTownTemplePosition(pos) if(not pos or isInArray({pos.x, pos.y}, 0)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong temple position for town " .. tmp .. ".") return true end pos = getClosestFreeTile(tid, pos) if(not pos 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, true) and not isPlayerGhost(tid)) then doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(pos, CONST_ME_TELEPORT) end return true end <talkaction log="yes" words="/t" access="2" event="script" value="teleportmaster.lua"/>
Postado Agosto 14, 2015 9 anos Autor Em 13/08/2015 em 16:32, Animal Pak disse: Deixa seu teleporttown.lua assim: function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local tid = cid local t = string.explode(param, ",") if(t[2]) then tid = getPlayerByNameWildcard(t[2]) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.") return true end end local 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 local pos = getTownTemplePosition(tmp, false) if(not pos 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(not pos 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, true) and not isPlayerGhost(tid)) then doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(pos, CONST_ME_TELEPORT) end return true end <talkaction log="yes" words="/town" access="2" event="script" value="teleporttown.lua"/> E deixe seu teleportmaster.lua assim: function onSay(cid, words, param, channel) local tid = cid if(param ~= '') then tid = getPlayerByNameWildcard(param) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end end local pos = getPlayerTown(tid) local tmp = getTownName(pos) if(not tmp) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Home town does not exists.") return true end pos = getTownTemplePosition(pos) if(not pos or isInArray({pos.x, pos.y}, 0)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong temple position for town " .. tmp .. ".") return true end pos = getClosestFreeTile(tid, pos) if(not pos 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, true) and not isPlayerGhost(tid)) then doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(pos, CONST_ME_TELEPORT) end return true end <talkaction log="yes" words="/t" access="2" event="script" value="teleportmaster.lua"/> Ae pronto, já posso dar rep, solucionado !!!
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.