CA
pedido

Fly System

Por Carnavotu, 20 de jun. de 2012 em Scripts

otserv
tibia
script
7
1.3k
CarnavotuC
20 de junho de 2012 às 11:46

Tenho o script de fly do vip by mock, so que quando acaba a vip do player ele continua a falar pelo sistema.

 

 

function onSay(cid, words, param)

local config = {

pz = true, -- players precisam estar em protection zone para usar? (true or false)

battle = true, -- players deve estar sem battle (true or false)

custo = true, -- se os teleport irão custa (true or false)

need_level = true, -- se os teleport irão precisar de level (true or false)

vip = true -- se precisa ser vip account (true or false)

}

--[[ Config lugares]]--

local lugar = {

["depot"] = { -- nome do lugar

pos = {x=131, y=53, z=7},level = 5,price = 1000},

["templo"] = { -- nome do lugar

pos = {x=160, y=51, z=7},level = 10, price = 1000},

["arena"] = { -- nome do lugar

pos = {x=157, y=62, z=7},level = 15,price = 1000},

["area vip"] ={ -- nome do lugar

pos = {x=305, y=934, z=7},level = 20,price = 1000}

}

--[[ Lista de Viagem (Não mexa) ]]--

if (param == "lista") then

local str = ""

str = str .. "lista de viagem :\n\n"

for name, pos in pairs(lugar) do

str = str..name.."\n"

end

str = str .. ""

doShowTextDialog(cid, 6579, str)

return TRUE

end

 

local a = lugar[param]

if not(a) then

doPlayerSendTextMessage(cid, 22, "desculpe,este lugar não existe")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")

return TRUE

elseif config.vip == true and vip.getVip(cid) == 0 then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com vip account podem teleportar.")

return TRUE

elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.")

return TRUE

elseif config.need_level == true and getPlayerLevel(cid) < a.level then

doPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then

doPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

end

doTeleportThing(cid, a.pos)

doSendMagicEffect(a.pos, CONST_ME_TELEPORT)

doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".")

return TRUE

end

 

 

Abrass mdr.gif

Editado Junho 20 por Carnavotu

LeoxtibiaL
20 de junho de 2012 às 13:37

@Luminous

O sistema do Mock não é por storage, acho que só funcionaria por vip.hasVip(cid). Aqui está o script:

 

 

 

 

function onSay(cid, words, param)

local config = {

pz = true, -- players precisam estar em protection zone para usar? (true or false)

battle = true, -- players deve estar sem battle (true or false)

custo = true, -- se os teleport irão custa (true or false)

need_level = true, -- se os teleport irão precisar de level (true or false)

vip = true -- se precisa ser vip account (true or false)

}

--[[ Config lugares]]--

local lugar = {

["depot"] = { -- nome do lugar

pos = {x=131, y=53, z=7},level = 5,price = 1000},

["templo"] = { -- nome do lugar

pos = {x=160, y=51, z=7},level = 10, price = 1000},

["arena"] = { -- nome do lugar

pos = {x=157, y=62, z=7},level = 15,price = 1000},

["area vip"] ={ -- nome do lugar

pos = {x=305, y=934, z=7},level = 20,price = 1000}

}

--[[ Lista de Viagem (Não mexa) ]]--

if (param == "lista") then

local str = ""

str = str .. "lista de viagem :\n\n"

for name, pos in pairs(lugar) do

str = str..name.."\n"

end

str = str .. ""

doShowTextDialog(cid, 6579, str)

return TRUE

end

local a = lugar[param]

if not(a) then

doPlayerSendTextMessage(cid, 22, "desculpe,este lugar não existe")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")

return TRUE

elseif config.vip == true and vip.hasVip(cid) == FALSE then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com vip account podem teleportar.")

return TRUE

elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.")

return TRUE

elseif config.need_level == true and getPlayerLevel(cid) < a.level then

doPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then

doPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

end

doTeleportThing(cid, a.pos)

doSendMagicEffect(a.pos, CONST_ME_TELEPORT)

doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".")

return TRUE

end

 

 

CarnavotuC
21 de junho de 2012 às 19:37

Leoxtibia mais voce arrumou o bug, porque o meu script ele fala certin, o unico problema é quando acaba a vip do player ele consegue usar o sistema entendeu?

 

Abrass mdr.gif

LeoxtibiaL
21 de junho de 2012 às 19:39

Sim, testa primeiro.

CarnavotuC
24 de junho de 2012 às 02:13

Leoxtibia funcionou, obrigado !

 

Abrass mdr.gif

beddyB
24 de junho de 2012 às 09:28

Duvida sanada, topico reportado!

 

Acho melhor o script do Vodkart desse "fly" (que na verdade é teleport)

VildenV
24 de junho de 2012 às 13:28

Dúvida sanada, movido.