CA

Fly System

Por Carnavotu, 30 de set. de 2011 em Scripts

script
19
3.1k
CarnavotuC
30 de setembro de 2011 às 14:06

Eai galera, preciso de ajuda de voce eu tento usar o fly mais ele fala que precisa ter vip account se ja tenho vip.

 

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.getVip(cid) 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

 

 

Quem pode ajudar ai agradeço

 

Abrass

digo1040D
30 de setembro de 2011 às 14:29

--ATUALIZADO--2

Eai, tudo bem?

Tente assim:

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

 

Qualquer dúvida so postar :P:

Editado Setembro 30 por Digaao

CarnavotuC
30 de setembro de 2011 às 15:48

Agora vai, mas mesmo uma pessoa que não e vip consegue usar

 

Abrass

MulizeuM
30 de setembro de 2011 às 15:56

Removido--

 

Removi porque estou sem onde testar e sem tempo tbm!

 

malz flw'z

Editado Setembro 30 por mulizeu

Henrique MouraH
30 de setembro de 2011 às 15:57

Removido ---

Se o do diego não funcionar, da 1 toque.

 

Abs

Editado Setembro 30 por Henrique Moura

CarnavotuC
30 de setembro de 2011 às 16:00

Mulizeu esta a mesma coisa que antes, mesmo não sendo vip usa

 

Abrass

Editado Setembro 30 por Carnavotu

Henrique MouraH
30 de setembro de 2011 às 16:02

Tá usando o sistema de vip correspondente ao do script?

MulizeuM
30 de setembro de 2011 às 16:02

eu editei la tente agr!

CarnavotuC
30 de setembro de 2011 às 16:04

Henrique sim estou usando o correspondente com a vip o elseif config.vip == true and vip.getVip(cid) == false then

 

Abrass

digo1040D
30 de setembro de 2011 às 16:05

Qual o vip system que você utiliza?

 

-- edit enviamos no mesmo minuto kk

Editado Setembro 30 por Digaao

CarnavotuC
30 de setembro de 2011 às 16:07

Ainda não esta funcionando, uso o monck system, conhece?

 

Sim mesmo minuto

 

Abrass

Editado Setembro 30 por Carnavotu

Henrique MouraH
30 de setembro de 2011 às 16:11
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) == false then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce nao e vip")
return FALSE
elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battle 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

digo1040D
30 de setembro de 2011 às 16:11

eai, conheço ele, atualizei o codigo no meu post, testa ele e diz se da algum erro alguma coisa :P:

CarnavotuC
30 de setembro de 2011 às 16:20

Não funcionou, agora foi ao contrario nem player vip e free podia telesportar

 

Abrass

digo1040D
30 de setembro de 2011 às 16:25

Atualizei o post denovo, se não funcionar na linha abaixo de:

function onSay(cid, words, param)

coloque isso:

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, vip.getVip(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, tostring(vip.getVip(cid)))

vai ficar assim:

function onSay(cid, words, param)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, vip.getVip(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, tostring(vip.getVip(cid)))
local config = {

 

E poste as mensagens que aparecerem no console em azul e se o player era vip ou nao.

Editado Setembro 30 por Digaao