Ir para conteúdo

Featured Replies

Postado

Estou precisando de ajuda em algumas scripts, as que estou quebrando a cabeça são:

 

*Fly por Talkaction teria que ser Premium para usar, mas players Free também usam !

*Surf teria que ser Premium para usar mas players Free também usam !

*O Tile Premium, o player teria que ser premium para passar por ele, isso ta funcionando, o problema é que se o player for premium ao invez de ele passar pelo tile sem problemas ele é teleportado pra CP '-' Esse é o problema do Tile Premium, se não for Premium não passa, se for passa mas é teleportado pra CP :S vou deixar as Scripts que estou usando:

 

Fly por Talkaction

function onSay(cid, words, param)
if param ~= '' and getPlayerGroupId(cid) >= 0 then
local cida = getPlayerByName(param)
if cida and isPlayer(cida) then
fly.win(cida)
end
return true
end

local pokes = {
['Moltres'] = {229, 800},
['Lugia'] = {229, 800},
['Ancient Moltres'] = {229, 800},
['Articuno'] = {230, 800},
['Ancient Articuno'] = {230, 800},
['Zapdos'] = {224, 800},
['Ancient Zapdos'] = {224, 800},
['Mew'] = {232, 800},
['Ancient Mew'] = {232, 800},
['Ho Oh'] = {232, 800},
['Mewtwo'] = {233, 800},
['Ancient Mewtwo'] = {233, 800},
['Ancient Lugia'] = {234, 800},
['Dragonite'] = {221, 300},
['Pidgeot'] = {222, 350},
['Fearow'] = {222, 400},
['Aerodactyl'] = {227, 490},
['Charizard'] = {216, 590},
}

local pokemon = pokes[getCreatureName(getCreatureSummons(cid)[1])]
local name = getCreatureName(getCreatureSummons(cid)[1])
local old_speed = getCreatureBaseSpeed(cid)
local summons = getCreatureSummons(cid)

if isPremium(cid) then
doPlayerSendCancel(cid, "Você não é premium account.")
end

if getPlayerStorageValue(cid, 17000) == 10 then
return doPlayerSendCancel(cid, "Você já está voando.")
end

if #getCreatureSummons(cid) < 1 then
doPlayerSendCancel(cid, "Para voar você precisa de um pokemon")
return 1
end



if not pokes[name] then
return doPlayerSendCancel(cid, "Este pokemon não pode voar.")
end
doChangeSpeed(cid, pokemon[2])
setPlayerStorageValue(cid, 17000, 10)
setPlayerStorageValue(cid, 23000, 5)
doSetCreatureOutfit(cid, {lookType = pokemon[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid, "aid", getCreatureHealth(getCreatureSummons(cid)[1]))
function getPokemonId(summons)
for _, pid in ipairs(summons) do
return pid
end
end
doRemoveCreature(getPokemonId(summons))
doPlayerSay(cid, name .. ", Vamos voar!", TALKTYPE_SAY)
doPlayerSendTextMessage(cid,27,'Fale \'h1\' e \'h2\'.' )
if fly.using(cid) then
local p = getCreaturePosition(cid)
p.stackpos = 0
local f = getTileThingByPos(p)
if fly.del(cid) then
if f.itemid ~= 0 and f.itemid ~= 1 and f.itemid ~= CONST_FLYVOID then
return true
else
setPlayerStorageValue(cid,10941,1)
local p = getCreaturePosition(cid)
setPlayerStorageValue(cid, 102011,p.x)
setPlayerStorageValue(cid, 102012,p.y)
setPlayerStorageValue(cid, 102013,p.z)
return true
end
else
doPlayerSendTextMessage(cid,27,'Você não pode voar neste local.')
end
else
if fly.add(cid) then
local pos = getCreaturePosition(cid)
if getSqmId(pos).itemid == 10217 then
down.gerarEmVolta(pos)
end
return true
else
doPlayerSendTextMessage(cid,27,'Diga !fly e seu nome. Exemplo !fly Charizard. Logo em seguida, diga !stopfly e diga !fly novamente.')
return true
end
end
return true
end

 

Surf ( Não é por Talkaction, vou mandar o action dele )

function onUse(cid, item, frompos, item2, topos)
local configs = {
[4647] = {x = -2, y = 0}, -- 4647 é o id da borda oeste (lado esquerdo do player) ----- Deixa assim
[4645] = {x = 2, y = 0}, -- 4645 é o id da borda leste (lado direito do player) ----- Deixa assim
[4646] = {x = 0, y = 2}, -- 4646 é o id da borda sul (abaixo do player) ----- Deixa assim
[4644] = {x = 0, y = -2}, -- 4644 é o id da borda norte (acima do player) ----- Deixa assim
}

local playerpos = getCreaturePosition(cid)
local pokes = {
["Poliwag"] = {lookType=278, speed = 250},
["Tentacruel"] = {lookType=185, speed = 250},
["Blastoise"] = {lookType=184, speed = 250},
["Dewgong"] = {lookType=183, speed = 250},
["Kabutops"] = {lookType=189, speed = 250},
["Omastar"] = {lookType=188, speed = 250},
["Gyarados"] = {lookType=187, speed = 250},
["Poliwrath"] = {lookType=190, speed = 250},
["Shiny Gyarados"] = {lookType=529, speed = 250},
["Shiny Seadra"] = {lookType=522, speed = 250},
["Shiny Tentacruel"] = {lookType=522, speed = 250},
["Squirtle"] = {lookType=273, speed = 250},
["Shiny Blastoise"] = {lookType=523, speed = 250},
["Wartotle"] = {lookType=275, speed = 250},
['Tentacool'] = {lookType=274, speed = 250},
['Staryu'] = {lookType=266, speed = 250},
['Starmie'] = {lookType=267, speed = 250},
['Golduck'] = {lookType=271, speed = 250},
['Poliwhirl'] = {lookType=137, speed = 250},
['Tentacool'] = {lookType=277, speed = 250},
['Goldeen'] = {lookType=268, speed = 250},
['Seaking'] = {lookType=269, speed = 250},
['Seadra'] = {lookType=270, speed = 250},
['Snorlax'] = {lookType=300, speed = 250},
['Vaporeon'] = {lookType=191, speed = 250},
}

if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
return doPlayerSendCancel(cid, "You need a pokemon to surf.")
end

l = false
for i,x in pairs(pokes) do
if getPlayerStorageValue(cid, 63215) <= 0 and i:lower() == getCreatureName(getCreatureSummons(cid)[1]):lower() then
l = true
end
end

if not l and getPlayerStorageValue(cid, 63215) <= 0 then
return doPlayerSendCancel(cid, "This pokemon can't surf.")
end

if getPlayerStorageValue(cid, 63215) <= 0 then
doTeleportThing(cid, {x=playerpos.x+configs[item2.itemid].x, y=playerpos.y+configs[item2.itemid].y, z=playerpos.z})
setPlayerStorageValue(cid, 63215, 1)
doSetCreatureOutfit(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])], -1)
doCreatureSay(cid, "Let's surf, "..getCreatureName(getCreatureSummons(cid)[1]), 1)
setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1]))
setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1]))
doChangeSpeed(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])].speed)
doRemoveCreature(getCreatureSummons(cid)[1])
else
doTeleportThing(cid, {x=playerpos.x-configs[item2.itemid].x, y=playerpos.y-configs[item2.itemid].y, z=playerpos.z})
setPlayerStorageValue(cid, 63215, 0)
doRemoveCondition(cid, CONDITION_OUTFIT)
local item = getPokeOutLive(cid)[1]
doCreatureSay(cid, "Im tired of surf, " .. getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), 1)
pk = doSummonCreature(getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), getThingPosition(cid))
doConvinceCreature(cid, pk)
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
setCreatureMaxHealth(pk, getPlayerStorageValue(cid, 61209))
doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61209))
doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61210)-getPlayerStorageValue(cid, 61209))
doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid))
end
return TRUE
end

 

Tile Premium ( Movements )

local npos = {x=1063, y=1049, z=7} --- posição para onde sera teleportado
function onStepIn(cid, item, position, fromPosition, toPosition)
if isPremium(cid) then
doTeleportThing(cid, npos)
doSendMagicEffect(npos,10)
else
doTeleportThing(cid, fromPosition)
doPlayerSendCancel(cid, "Você não é Premium Account.")
end
return true
end

 

eR3Xwgv.png?1
 

Postado

No caso dos tiles premium, tente usar essa função de minha autoria, que é bem mais agradavel, e sem bugs.

Para usa-la, é muito simples, só colocar o actionid do tile, no caso do exemplo abaixo é 3131...

Qualquer duvida de como usa-la, olha esse tópico...

 

http://tibiaking.com/forum/topic/26903-help-sistema-vip/?p=152712

 

vips = {} vips.__index = vips

function vips.moveBack(cid, fromPosition, text)     doTeleportThing(cid, fromPosition, TRUE)
    doPlayerSendCancel(cid, text)
end

function onStepIn(cid, item, position, fromPosition)   

 if item.actionid == 3131 then
           if(getPlayerPremiumDays(cid) < 1) then
                vips.moveBack(cid, fromPosition, "apenas vips podem passar.")
            end
    end
end

 

 

 

No fly muda essa linha:
 

if isPremium(cid) then
doPlayerSendCancel(cid, "Você não é premium account.")
end

 

 

Para isso:
 

if not isPremium(cid) then
return doPlayerSendCancel(cid, "Você não é premium account.")

end

 

 

Não tenho certeza que va funcionar, pois não é minha área poketibias. Mas deve ser a mesma coisa que Tibia em sí.

 

Se não funcionar, tenta assim:

 

 

if getPlayerVipDays(cid) < 1 then
return doPlayerSendCancel(cid, "Você não é premium account.")
end

 

 

 

E no stuff, adiciona esta mesma função acima, no codigo também, de preferencia acima dessa parte..

 

if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
return doPlayerSendCancel(cid, "You need a pokemon to surf.")
end

 

Pq não te dou o codigo pronto????
Pq prefiro, que façam dessa maneira, assim vao aprendendo, e não apenas copiando e colando...

 

 

Att...

Rep++ Se ajudei??? Bobagem!!!
Prefiro mil vezes um agradecimento gentil, com educação e sinceridade.
-------------------------------------------------------------------------------------------------------------------------


 

Postado
  • Autor

Ok, vou testar, se funcionar aviso.

 

Edited: Ae man, funfou tranquilo Rep++ Vlw ae agr só to com o problema no Teleport, quando falo !teleport "CITY não ta teleportando, mas isso é facil vlw ae

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

eR3Xwgv.png?1
 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo