AdilsonHacker 98 Postado Maio 30, 2015 Share Postado Maio 30, 2015 (editado) Galera, tenho um script de teleport e queria fazer a seguinte mudança, queria que apenas tal vocation id podesse viajar pra o tal local configurado Exemplo apenas as vocation id 1,2,3 pode ir as que não pode diz a seguinte mensagem "Você não é digno de ir para esse lugar". O script para a seguinte edição é esse: function onSay(cid, words, param) local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } local STORAGE_JAIL = 50026 --[[ Config lugares]]-- local lugar = { ["divland"] = { -- nome do lugar pos = {x=982, y=1298, z=7},level = 1,price = 0, premium = 0} } local a = lugar[param] local STORAGE_IR = 12701 local delay = 1 * 1.2 local lastUse = getPlayerStorageValue(cid, STORAGE_IR) local ticks = os.time() - lastUse if ticks < delay then return true else setPlayerStorageValue(cid, STORAGE_IR, os.time()) end if not(a) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Divland.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP tem esse recurso.") return TRUE elseif getPlayerStorageValue(cid, STORAGE_JAIL) > os.time() then doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, 'Você só pode sair as '.. os.date("%H:%M:%S", getPlayerStorageValue(cid, STORAGE_JAIL))..' (agora são: ' .. os.date("%H:%M:%S", os.time()) .. ').') return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return TRUE end if a.premium == 1 and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP podem acessar esse lugar.") return TRUE else doSendMagicEffect(getPlayerPosition(cid),27) doTeleportThing(cid, a.pos) doSendMagicEffect(getPlayerPosition(cid),40) end return TRUE end [/code] Agradeço desde já. Editado Maio 30, 2015 por AdilsonTsunami Link para o comentário https://xtibia.com/forum/topic/234306-apenas-tal-vocation-id-pode-usar-essa-talkactions/ Compartilhar em outros sites More sharing options...
L3K0T 149 Postado Maio 30, 2015 Share Postado Maio 30, 2015 Galera, tenho um script de teleport e queria fazer a seguinte mudança, queria que apenas tal vocation id podesse viajar pra o tal local configurado Exemplo apenas as vocation id 1,2,3 pode ir as que não pode diz a seguinte mensagem "Você não é digno de ir para esse lugar". O script para a seguinte edição é esse: function onSay(cid, words, param) local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } local STORAGE_JAIL = 50026 --[[ Config lugares]]-- local lugar = { ["divland"] = { -- nome do lugar pos = {x=982, y=1298, z=7},level = 1,price = 0, premium = 0} } local a = lugar[param] local STORAGE_IR = 12701 local delay = 1 * 1.2 local lastUse = getPlayerStorageValue(cid, STORAGE_IR) local ticks = os.time() - lastUse if ticks < delay then return true else setPlayerStorageValue(cid, STORAGE_IR, os.time()) end if not(a) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Divland.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP tem esse recurso.") return TRUE elseif getPlayerStorageValue(cid, STORAGE_JAIL) > os.time() then doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, 'Você só pode sair as '.. os.date("%H:%M:%S", getPlayerStorageValue(cid, STORAGE_JAIL))..' (agora são: ' .. os.date("%H:%M:%S", os.time()) .. ').') return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return TRUE end if a.premium == 1 and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP podem acessar esse lugar.") return TRUE else doSendMagicEffect(getPlayerPosition(cid),27) doTeleportThing(cid, a.pos) doSendMagicEffect(getPlayerPosition(cid),40) end return TRUE end [/code] Agradeço desde já. function onSay(cid, words, param) local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } local STORAGE_JAIL = 50026 --[[ Config lugares]]-- local lugar = { ["divland"] = { -- nome do lugar pos = {x=982, y=1298, z=7},level = 1,price = 0, premium = 0} } local a = lugar[param] local STORAGE_IR = 12701 local delay = 1 * 1.2 local lastUse = getPlayerStorageValue(cid, STORAGE_IR) local ticks = os.time() - lastUse if ticks < delay then return true else setPlayerStorageValue(cid, STORAGE_IR, os.time()) end if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 3 then if not(a) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Divland.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP tem esse recurso.") return TRUE elseif getPlayerStorageValue(cid, STORAGE_JAIL) > os.time() then doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, 'Você só pode sair as '.. os.date("%H:%M:%S", getPlayerStorageValue(cid, STORAGE_JAIL))..' (agora são: ' .. os.date("%H:%M:%S", os.time()) .. ').') return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return TRUE end end if a.premium == 1 and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP podem acessar esse lugar.") return TRUE else doSendMagicEffect(getPlayerPosition(cid),27) doTeleportThing(cid, a.pos) doSendMagicEffect(getPlayerPosition(cid),40) end return TRUE end Link para o comentário https://xtibia.com/forum/topic/234306-apenas-tal-vocation-id-pode-usar-essa-talkactions/#findComment-1653424 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Maio 30, 2015 Share Postado Maio 30, 2015 (editado) Abaixo de: function onSay(cid, words, param) coloque: local vocations = {1, 2, 3} --Vocações que podem teleportar. if not isInArray(vocations, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "Você não é digno de ir para esse lugar.") end Editado Maio 30, 2015 por zipter98 Azazel428 reagiu a isso 1 Link para o comentário https://xtibia.com/forum/topic/234306-apenas-tal-vocation-id-pode-usar-essa-talkactions/#findComment-1653425 Compartilhar em outros sites More sharing options...
AdilsonHacker 98 Postado Maio 30, 2015 Autor Share Postado Maio 30, 2015 Funcionou, obrigado. Só que no meu script mesmo é vários canto que você pode se teleportar mais queria destacar só cidade que apenas tal vocation id possam viajar pra ela, por que se eu criar outro script apenas com essa city por exemplo, eu digo /viajar e aparece todos lugares que posso ir, ai se eu adicionar /viajar divland vai ser como tivesse usando o /viajar normal dai queria sabe se tem como destacar ela por exemplo: local vocations = {1, 2, 3} --Vocações que podem teleportar apenas para divland. local lugar = ["divland"] = { -- nome do lugar pos = {x=1510, y=1235, z=7},level = 1,price = 0, premium = 0 if not isInArray(vocations, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "Você não é digno de ir para esse lugar.") end Só que ao viajar para outra cidade que não esteja adicionado a função de vocation id ele viajasse de boa.OBS: isso não é funcional rss é apenas um exemplo de como queria que funcionasse, obrigado e rep+ Link para o comentário https://xtibia.com/forum/topic/234306-apenas-tal-vocation-id-pode-usar-essa-talkactions/#findComment-1653453 Compartilhar em outros sites More sharing options...
Bruno 536 Postado Julho 14, 2015 Share Postado Julho 14, 2015 O tópico foi fechado e movido para lixeira por estar inativo a mais de 10 dias. Caso seja preciso reabrir o mesmo, favor entrar em contato com a equipe. Link para o comentário https://xtibia.com/forum/topic/234306-apenas-tal-vocation-id-pode-usar-essa-talkactions/#findComment-1660197 Compartilhar em outros sites More sharing options...
Posts Recomendados