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






info
Grupo: Visconde
Registrado: 24/11/12
Posts: 474
Reputação: +98
Gênero: Masculino
Editado Maio 30 por AdilsonTsunami