Ir para conteúdo

Featured Replies

Postado

Bom dia amigos do TK!

 

Venho humildemente pedir a ajuda de vocês para limitar o meu sistema de fly somente a players VIP.

 

Atualmente qualquer um tem usado o sistema, free e vips, gostaria de regular isso ;D

 

Segue meu fly.lua

local del = {'460', '1022', '1023', '1024'}



function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

position.stackpos = 0

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

if getPlayerStorageValue(cid, 17000) <= 0 then
doTeleportThing(cid, fromPosition, false)
doRemoveItem(getTileThingByPos(position).uid, 1)
doPlayerSendCancel(cid, "You can't fly.")
return true
end

doAreaCombatHealth(cid, FLYSYSTEMDAMAGE, getThingPos(cid), splash, 0, 0, 255)

local pos = getThingPos(cid)
if pos.z == 7 then return true end
pos.z = pos.z + 1

for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, 3) or hasProperty(tile.uid, 7) or tile.itemid == 919 then
doTransformItem(item.uid, 11677)
end
end
end

return true
end

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

local effect = 2

if toPosition.z == fromPosition.z and getCreatureOutfit(cid).lookType ~= 316 and getCreatureOutfit(cid).lookType ~= 648 then
doSendMagicEffect(fromPosition, effect)
end

local oldtpos = fromPosition
oldtpos.stackpos = STACKPOS_GROUND


if getTileThingByPos(oldtpos).itemid >= 1 then
doRemoveItem(getTileThingByPos(oldtpos).uid, 1)
end

return true
end

 

Acredito que não seja tão dificil de arrumar, mas estou deixando passar alguma parte :/

 

Agradeço a ajuda de todos, e REP pra todos que tentarem ajudar!

Resolvido por Ken Kaneki

Ir para solução
  • Respostas 15
  • Visualizações 824
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Isso mesmo, você poderia adicionar pocições ou mudar as que tão ali... No seu script tem if getPlayerStorageValue(cid, 17000) <= 0 then ali em vermelho coloque o Storage da sua VIP

  • add essa tage  local premium = true ficando assim  

  • vá em data/talkaction/scripts e crie um arquivo chamado teleportvip.lua e cole isso dentro: depois vá em talkactions.xml e adicione éssa linha:   EXPLICANDO:

Postado

add essa tage

 local premium = true

ficando assim

 


local del = {'460', '1022', '1023', '1024'}

local premium = true

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

position.stackpos = 0

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

if getPlayerStorageValue(cid, 17000) <= 0 then
doTeleportThing(cid, fromPosition, false)
doRemoveItem(getTileThingByPos(position).uid, 1)
doPlayerSendCancel(cid, "You can't fly.")
return true
end

doAreaCombatHealth(cid, FLYSYSTEMDAMAGE, getThingPos(cid), splash, 0, 0, 255)

local pos = getThingPos(cid)
if pos.z == 7 then return true end
pos.z = pos.z + 1

for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, 3) or hasProperty(tile.uid, 7) or tile.itemid == 919 then
doTransformItem(item.uid, 11677)
end
end
end

return true
end

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

local effect = 2

if toPosition.z == fromPosition.z and getCreatureOutfit(cid).lookType ~= 316 and getCreatureOutfit(cid).lookType ~= 648 then
doSendMagicEffect(fromPosition, effect)
end

local oldtpos = fromPosition
oldtpos.stackpos = STACKPOS_GROUND


if getTileThingByPos(oldtpos).itemid >= 1 then
doRemoveItem(getTileThingByPos(oldtpos).uid, 1)
end

return true
end

Editado por lerme (veja o histórico de edições)

Se Ajudei Clique no rep_up.png ao Lado, Não Custa nada  :D!! 

e se resovel o problema não esqueça de em EEkog5AK0.png  :D 

 

____________________________________________________________________________________________________

 

Formação de Equipe para poketibia venha fazer parte dessa equipe

 

[bAIXEM] Sprites de icones para poketibia

Postado

vá em data/talkaction/scripts e crie um arquivo chamado teleportvip.lua e cole isso dentro:

 

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)
vip = true -- se precisa ser vip (true or false)
}
 
--[[ Config lugares]]--
local lugar = {
["depot"] = { -- nome do lugar
pos = {x=1114, y=918, z=7},level = 5,price = 1000},
["temple"] = { -- nome do lugar
pos = {x=1120, y=1099, z=7},level = 10, price = 2000},
["arena"] = { -- nome do lugar
pos = {x=728, y=584, z=7},level = 15,price = 3000},
["viparea"] ={ -- nome do lugar
pos = {x=1497, y=1495, z=7},level = 20,price = 4000}
}
 
--[[ Lista de Viagem (Não mexa) ]]--
if (param == "list") 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
doPlayerPopupFYI(cid,"Desculpe, este lugar não existe")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
doPlayerPopupFYI(cid,"Você precisa estar em protection zone pra poder teleportar.")
return TRUE
elseif config.vip == true and getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
doPlayerPopupFYI(cid,"Apenas players vips podem teleportar.")
return TRUE
elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerPopupFYI(cid,"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)
doBroadcastMessage("" .. getPlayerName(cid) .. " has flown to " .. param .. " using !fly ", MESSAGE_INFO_DESCR)
return TRUE
end

depois vá em talkactions.xml e adicione éssa linha:

 

<talkaction words="!fly" script="teleportvip.lua"/>

 

EXPLICANDO:

Aqui néssa parte você coloca a Storage da sua VIP

elseif config.vip == true and getPlayerStorageValue(cid, 13540) - os.time() <= 0 then

 

e aqui néssa parte:["depot"] = { -- nome do lugar

pos = {x=1114, y=918, z=7},level = 5,price = 1000},
["temple"] = { -- nome do lugar
pos = {x=1120, y=1099, z=7},level = 10, price = 2000},
["arena"] = { -- nome do lugar
pos = {x=728, y=584, z=7},level = 15,price = 3000},
["viparea"] ={ -- nome do lugar

pos = {x=1497, y=1495, z=7},level = 20,price = 4000} é as pocições de onde o player será teleportado

Editado por Dieguiin XP (veja o histórico de edições)

Att,
Dieguiin XP

 

»»http://baiakfull.com/««

Postado
  • Autor

add essa tage

 local premium = true

ficando assim

 

local del = {'460', '1022', '1023', '1024'}

local premium = true

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

position.stackpos = 0

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

if getPlayerStorageValue(cid, 17000) <= 0 then

doTeleportThing(cid, fromPosition, false)

doRemoveItem(getTileThingByPos(position).uid, 1)

doPlayerSendCancel(cid, "You can't fly.")

return true

end

doAreaCombatHealth(cid, FLYSYSTEMDAMAGE, getThingPos(cid), splash, 0, 0, 255)

local pos = getThingPos(cid)

if pos.z == 7 then return true end

pos.z = pos.z + 1

for i = 0, 255 do

pos.stackpos = i

local tile = getTileThingByPos(pos)

if tile.itemid ~= 0 and not isCreature(tile.uid) then

if hasProperty(tile.uid, 3) or hasProperty(tile.uid, 7) or tile.itemid == 919 then

doTransformItem(item.uid, 11677)

end

end

end

return true

end

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)

if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

local effect = 2

if toPosition.z == fromPosition.z and getCreatureOutfit(cid).lookType ~= 316 and getCreatureOutfit(cid).lookType ~= 648 then

doSendMagicEffect(fromPosition, effect)

end

local oldtpos = fromPosition

oldtpos.stackpos = STACKPOS_GROUND

if getTileThingByPos(oldtpos).itemid >= 1 then

doRemoveItem(getTileThingByPos(oldtpos).uid, 1)

end

return true

end

 Essa tag torna obrigatório a condição de Vip para o player? Não é necessário fazer a verificação ?

 

vá em data/talkaction/scripts e crie um arquivo chamado teleportvip.lua e cole isso dentro:

depois vá em talkactions.xml e adicione éssa linha:

 

EXPLICANDO:

Aqui néssa parte você coloca a Storage da sua VIP

elseif config.vip == true and getPlayerStorageValue(cid, 13540) - os.time() <= 0 then

 

e aqui néssa parte:["depot"] = { -- nome do lugar

pos = {x=1114, y=918, z=7},level = 5,price = 1000},
["temple"] = { -- nome do lugar
pos = {x=1120, y=1099, z=7},level = 10, price = 2000},
["arena"] = { -- nome do lugar
pos = {x=728, y=584, z=7},level = 15,price = 3000},
["viparea"] ={ -- nome do lugar

pos = {x=1497, y=1495, z=7},level = 20,price = 4000} é as pocições de onde o player será teleportado

Pelo que entendi, o player diria !fly temple e seria teleportado para o templo?

Postado

 Essa tag torna obrigatório a condição de Vip para o player? Não é necessário fazer a verificação ?

 

Pelo que entendi, o player diria !fly temple e seria teleportado para o templo?

Isso mesmo, você poderia adicionar pocições ou mudar as que tão ali...

No seu script tem if getPlayerStorageValue(cid, 17000) <= 0 then ali em vermelho coloque o Storage da sua VIP

Editado por Dieguiin XP (veja o histórico de edições)

Att,
Dieguiin XP

 

»»http://baiakfull.com/««

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo