Postado Setembro 30, 2018 6 anos Como colocar pra quando estiver acontecendo algum evento o comando não funcione? E aparece alguma mensagem. Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
Postado Outubro 1, 2018 6 anos tem como colocar restrição de lugar? tipo, se você estiver em uma área você não pode usar esse comando(se teleportar). estou pedindo isso por que sempre aparece muito marmanjo no ot pra anuncar, trolar o servidor, então eu prendo ele e ele usa o comando para sair de lá, ai não tem graça
Postado Outubro 1, 2018 6 anos Autor @tetheuscunha @Emanueldk vocês pode usar assim para bloquear areas que nao podera usar o teleporte: Spoiler --[[ Teleport System Desenvolvido por Vodkart Exclusivo TibiaKing Versão : 1.0 ]]-- --[[ Configuração ]]-- local time = 5 -- tempo que demora para ser teleportado local premium_teleport_houses = true -- se para teleportar para as houses precisa ser premium local block_area = { {{x=909,y=1019,z=7}, {x=1000,y=1019,z=7}}, -- pos começo e final da area {{x=156,y=1019,z=7}, {x=200,y=1019,z=7}}, {{x=200,y=1019,z=7}, {x=300,y=1019,z=9}} } local teleports = { -- ["nome do lugar"] que poderá ir ["depot"] = {pos = {x=129, y=54, z=6}, premium = false}, -- posição que irá e se precisa de premium para ir! ["templo"] = {pos = {x=160, y=54, z=7}, premium = false}, ["arena"] = {pos = {x=125, y=351, z=9}, premium = false}, ["baiak city"] = {pos = {x=1028, y=1034, z=7}, premium = false} } --[[ Functions ]]-- function doTeleportWithDelay(cid, pos, delay) -- by vodkart if not isCreature(cid) then return LUA_ERROR end if delay > 0 then if getCreatureCondition(cid, CONDITION_INFIGHT) then setPlayerStorageValue(cid, 548745, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} O teletransporte foi desativado pois você entrou em estado de combate.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} "..delay.." segundos para se teletransportar.") addEvent(doTeleportWithDelay, 1000, cid, pos, delay-1) else doTeleportThing(cid, pos) doSendMagicEffect(getPlayerPosition(cid), 10) end end function getHouseInvite(cid) -- by vodkart local t = {} local qry = db.getResult("SELECT `house_id`,`list` FROM `house_lists`;") if (qry:getID() ~= -1) then repeat local lista = qry:getDataString("list") if string.find(lista, getCreatureName(cid)) then local id = qry:getDataInt("house_id") if not isInArray(t, id) then t[#t+1] = id end end until not qry:next() qry:free() end return t end function onSay(cid, words, param) local z = string.explode(param:lower(), ",") if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Este comando só pode ser usado fora de combate.") return true elseif getPlayerStorageValue(cid, 548745) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} aguarde, você está em processo de teletransporte.") return true end for _, var in ipairs(block_area) do if isInRange(getCreaturePosition(cid), var[1], var[2]) then doPlayerSendCancel(cid, "você não pode teleportar nesta area..") return true end end if z[1] == "casa" or z[1] == "house" then local t,invite,str = {},getHouseInvite(cid),'{Teleport} As casas disponíveis para você se teletransportar são:\n' if premium_teleport_houses == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} você precisa ser premium account para teleportar para houses.") return true end if getHouseByPlayerGUID(getPlayerGUID(cid)) ~= nil then t[#t+1] = getHouseByPlayerGUID(getPlayerGUID(cid)) end if #invite ~= 0 then for i = 1,#invite do t[#t+1] = invite[i] end end if #t == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} você não tem nenhuma house para ir.") return true end if not tonumber(z[2]) or tonumber(z[2]) > #t then for i = 1, table.maxn(t) do local h = getHouseInfo(t[i]) local hname, htown = getHouseName(t[i]),getTownName(h.town) str = str .. i .. ') '..hname..' [' .. htown..']' str = i ~= table.maxn(t) and str .. ', ' or str .. '.' end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Você deve especificar uma das casas para se teletransportar usando !tp house,numeroDoIndice") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) return true end setPlayerStorageValue(cid, 548745, os.time()+time) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Ativado.") doTeleportWithDelay(cid, getHouseEntry(t[tonumber(z[2])]), time) return true end if not teleports[z[1]] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Desculpe, este lugar não existe, lugares disponíveis: house, depot, templo, arena, baiak city.") return true elseif teleports[z[1]].premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Desculpe, você precisa ser premium para ir para este lugar.") return true end setPlayerStorageValue(cid, 548745, os.time()+time) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Ativado.") doTeleportWithDelay(cid, teleports[z[1]].pos, time) return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Outubro 2, 2018 6 anos 13 horas atrás, Vodkart disse: @tetheuscunha @Emanueldk vocês pode usar assim para bloquear areas que nao podera usar o teleporte: Mostrar conteúdo oculto --[[ Teleport System Desenvolvido por Vodkart Exclusivo TibiaKing Versão : 1.0 ]]-- --[[ Configuração ]]-- local time = 5 -- tempo que demora para ser teleportado local premium_teleport_houses = true -- se para teleportar para as houses precisa ser premium local block_area = { {{x=909,y=1019,z=7}, {x=1000,y=1019,z=7}}, -- pos começo e final da area {{x=156,y=1019,z=7}, {x=200,y=1019,z=7}}, {{x=200,y=1019,z=7}, {x=300,y=1019,z=9}} } local teleports = { -- ["nome do lugar"] que poderá ir ["depot"] = {pos = {x=129, y=54, z=6}, premium = false}, -- posição que irá e se precisa de premium para ir! ["templo"] = {pos = {x=160, y=54, z=7}, premium = false}, ["arena"] = {pos = {x=125, y=351, z=9}, premium = false}, ["baiak city"] = {pos = {x=1028, y=1034, z=7}, premium = false} } --[[ Functions ]]-- function doTeleportWithDelay(cid, pos, delay) -- by vodkart if not isCreature(cid) then return LUA_ERROR end if delay > 0 then if getCreatureCondition(cid, CONDITION_INFIGHT) then setPlayerStorageValue(cid, 548745, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} O teletransporte foi desativado pois você entrou em estado de combate.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} "..delay.." segundos para se teletransportar.") addEvent(doTeleportWithDelay, 1000, cid, pos, delay-1) else doTeleportThing(cid, pos) doSendMagicEffect(getPlayerPosition(cid), 10) end end function getHouseInvite(cid) -- by vodkart local t = {} local qry = db.getResult("SELECT `house_id`,`list` FROM `house_lists`;") if (qry:getID() ~= -1) then repeat local lista = qry:getDataString("list") if string.find(lista, getCreatureName(cid)) then local id = qry:getDataInt("house_id") if not isInArray(t, id) then t[#t+1] = id end end until not qry:next() qry:free() end return t end function onSay(cid, words, param) local z = string.explode(param:lower(), ",") if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Este comando só pode ser usado fora de combate.") return true elseif getPlayerStorageValue(cid, 548745) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} aguarde, você está em processo de teletransporte.") return true end for _, var in ipairs(block_area) do if isInRange(getCreaturePosition(cid), var[1], var[2]) then doPlayerSendCancel(cid, "você não pode teleportar nesta area..") return true end end if z[1] == "casa" or z[1] == "house" then local t,invite,str = {},getHouseInvite(cid),'{Teleport} As casas disponíveis para você se teletransportar são:\n' if premium_teleport_houses == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} você precisa ser premium account para teleportar para houses.") return true end if getHouseByPlayerGUID(getPlayerGUID(cid)) ~= nil then t[#t+1] = getHouseByPlayerGUID(getPlayerGUID(cid)) end if #invite ~= 0 then for i = 1,#invite do t[#t+1] = invite[i] end end if #t == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} você não tem nenhuma house para ir.") return true end if not tonumber(z[2]) or tonumber(z[2]) > #t then for i = 1, table.maxn(t) do local h = getHouseInfo(t[i]) local hname, htown = getHouseName(t[i]),getTownName(h.town) str = str .. i .. ') '..hname..' [' .. htown..']' str = i ~= table.maxn(t) and str .. ', ' or str .. '.' end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Você deve especificar uma das casas para se teletransportar usando !tp house,numeroDoIndice") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) return true end setPlayerStorageValue(cid, 548745, os.time()+time) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Ativado.") doTeleportWithDelay(cid, getHouseEntry(t[tonumber(z[2])]), time) return true end if not teleports[z[1]] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Desculpe, este lugar não existe, lugares disponíveis: house, depot, templo, arena, baiak city.") return true elseif teleports[z[1]].premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Desculpe, você precisa ser premium para ir para este lugar.") return true end setPlayerStorageValue(cid, 548745, os.time()+time) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Ativado.") doTeleportWithDelay(cid, teleports[z[1]].pos, time) return true end Vlw funcionou. Como coloco pra quando começar a contagem regressiva o player não puder mexer, ficar travado no tile? Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
Postado Outubro 2, 2018 6 anos 1 hora atrás, tetheuscunha disse: Vlw funcionou. Como coloco pra quando começar a contagem regressiva o player não puder mexer, ficar travado no tile? Tu tem o código fonte do servidor? Se sim: https://otland.net/threads/tfs-1-2-creature-setnomove-bool-creature-canmove.241979/ (o tutorial é pra tfs 1.2 mas deve funcionar) Editado Outubro 2, 2018 6 anos por arierref (veja o histórico de edições)
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.