Atenciosamente : AdilsonTsunami
Te ajudei? click em
Meus Trabalhos:
Atenciosamente : AdilsonTsunami
Te ajudei? click em
Meus Trabalhos:
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 lugarpos = {x=982, y=1298, z=7},level = 1,price = 0, premium = 0}}local a = lugar[param]local STORAGE_IR = 12701local delay = 1 * 1.2local lastUse = getPlayerStorageValue(cid, STORAGE_IR)local ticks = os.time() - lastUseif ticks < delay thenreturn trueelsesetPlayerStorageValue(cid, STORAGE_IR, os.time())endif not(a) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Divland.")return TRUEelseif config.premium == true and not isPremium(cid) thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP tem esse recurso.")return TRUEelseif getPlayerStorageValue(cid, STORAGE_JAIL) > os.time() thendoPlayerSendTextMessage (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 TRUEelseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.")return TRUEendif a.premium == 1 and not isPremium(cid) thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP podem acessar esse lugar.")return TRUEelsedoSendMagicEffect(getPlayerPosition(cid),27)doTeleportThing(cid, a.pos)doSendMagicEffect(getPlayerPosition(cid),40)endreturn TRUEend[/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
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
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
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+
Atenciosamente : AdilsonTsunami
Te ajudei? click em
Meus Trabalhos:
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.