DU

[Resolvido] Problema com Bike pokemon

Por Duhisback, 20 de fev. de 2016 em Resolvidos

pokemon
otpokemon
problema
resolvido
12
3.5k
DuhisbackD
20 de fevereiro de 2016 às 23:59

Olá galera, estou usando PDA e estou com pequenos problemas em relação a bike. Como pretendo colocar em shop vip eu coloquei o item movível, posso arrastar para bag e chão, relacionado a bike, no centurion eu podia usar a bike e tirar o pokemon da pokebola pelo icone da ball clicando com botão direito do mouse, neste pda o pokemon só sai da pokebola pelo pokebar, já clicando na ball ele só aceitar quando não esta usando a bike, já tentei usar o script do centurion mas ficou a mesma coisa sendo q no centurion funcionava tudo certo.

 

Ajude-me por favor

 

 

local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 3000}
local bikeid = 12774 -- ITEMID da Bike

local function BikeSpeedOn(cid, t)                  
    setPlayerStorageValue(cid, t.s, t.speed)
    doChangeSpeed(cid, -getCreatureSpeed(cid))
    doChangeSpeed(cid, t.speed)
end
 
local function BikeSpeedOff(cid, t)
    setPlayerStorageValue(cid, t.s, -1)
    doRegainSpeed(cid)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local pos = getThingPos(cid)
    if getPlayerItemCount(cid, 12774) <= 0 then
        return doPlayerSendCancel(cid, "Você precisa ter a bike na sua bag.")
    end
 
    -- if #getCreatureSummons(cid) >= 1 then
        -- return doPlayerSendCancel(cid, "Return your pokemon.")
    -- end
    if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or
        getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or
        getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
       return doPlayerSendCancel(cid, "You can't do that right now.")
    end

    if getPlayerStorageValue(cid, t.s) <= 0 then
        if item.actionid ~= 12120 then
            doRemoveItem(item.uid, 1)
            local create_action = doPlayerAddItem(cid, bikeid, 1)
            doItemSetAttribute(create_action, "aid", 12120)

            setPlayerStorageValue(cid, 12120, 1)
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.text, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.')
            BikeSpeedOn(cid, t)
            if getPlayerSex(cid) == 1 then
                doSetCreatureOutfit(cid, {lookType = 1787}, -1)
            else
                doSetCreatureOutfit(cid, {lookType = 1619}, -1)
            end
        else
            doPlayerSendCancel(cid, "This bike is in use.")
        end
    else
        if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 1787 or getCreatureOutfit(cid).lookType == 1619 then
            doRemoveItem(item.uid, 1)
            doPlayerAddItem(cid, bikeid, 1)
            setPlayerStorageValue(cid, 12120, -1)
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.dtext, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.')
            BikeSpeedOff(cid, t)
            doRemoveCondition(cid, CONDITION_OUTFIT)
        else
            doPlayerSendCancel(cid, "This bike isn't yours.")
        end
    end
    
return true
end

 

 

Editado Fevereiro 20 por Eduzinhonho

BluesterB
21 de fevereiro de 2016 às 02:47

 

 

local function BikeSpeedOn(cid, t)

setPlayerStorageValue(cid, t.s, t.speed)

doChangeSpeed(cid, -getCreatureSpeed(cid))

doChangeSpeed(cid, t.speed)

end

 

local function BikeSpeedOff(cid, t)

setPlayerStorageValue(cid, t.s, -1)

doRegainSpeed(cid)

end

 

local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 3000}

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

local pos = getThingPos(cid)

 

if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or

getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or

getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then --alterado v1.9

return doPlayerSendCancel(cid, "You can't do that right now.")

end

 

if getPlayerStorageValue(cid, t.s) <= 0 then

doSendMagicEffect(pos, 177)

doCreatureSay(cid, t.text, 19)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Voce montou na bike.')

BikeSpeedOn(cid, t)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1769}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1770}, -1)

end

else

doSendMagicEffect(pos, 177)

doCreatureSay(cid, t.dtext, 19)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Voce saiu da bike.')

BikeSpeedOff(cid, t)

doRemoveCondition(cid, CONDITION_OUTFIT)

end

return true

end

 

 

 

Usa esse, caso não funcione, continue com esse e vá em goback.lua na actions e apague:

 

 

if getPlayerStorageValue(cid, 5700) >=1

 

 

feito isso, será resolvido.

Editado Fevereiro 21 por Bluester

DuhisbackD
21 de fevereiro de 2016 às 11:08

 

 

local function BikeSpeedOn(cid, t)

setPlayerStorageValue(cid, t.s, t.speed)

doChangeSpeed(cid, -getCreatureSpeed(cid))

doChangeSpeed(cid, t.speed)

end

 

local function BikeSpeedOff(cid, t)

setPlayerStorageValue(cid, t.s, -1)

doRegainSpeed(cid)

end

 

local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 3000}

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

local pos = getThingPos(cid)

 

if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or

getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or

getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then --alterado v1.9

return doPlayerSendCancel(cid, "You can't do that right now.")

end

 

if getPlayerStorageValue(cid, t.s) <= 0 then

doSendMagicEffect(pos, 177)

doCreatureSay(cid, t.text, 19)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Voce montou na bike.')

BikeSpeedOn(cid, t)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1769}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1770}, -1)

end

else

doSendMagicEffect(pos, 177)

doCreatureSay(cid, t.dtext, 19)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Voce saiu da bike.')

BikeSpeedOff(cid, t)

doRemoveCondition(cid, CONDITION_OUTFIT)

end

return true

end

 

 

 

Usa esse, caso não funcione, continue com esse e vá em goback.lua na actions e apague:

 

 

if getPlayerStorageValue(cid, 5700) >=1

 

 

feito isso, será resolvido.

 

Olá amigo eu não consegui ai abri o arquivo goback.lua em actions e não encontrei aquela linha encontrei essa com o "cid 5700" ai eu removo essa linha completa ou alguma outra linha dentro do script logo abaixo dessa \/

 

 

 

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1

or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 5700) >= 1 then --alterado v1.9 <<

return true

end

 

 

 

O arquivo completo goback.lua é esse \/

 

 

 

local EFFECTS = {

--[OutfitID] = {Effect}

["Magmar"] = 35,

["Jynx"] = 17, --alterado v1.5

["Shiny Jynx"] = 17,

["Piloswine"] = 205, --alterado v1.8

["Swinub"] = 205,

}

 

function onUse(cid, item, frompos, item2, topos)

 

if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end

 

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1

or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 5700) >= 1 then --alterado v1.9 <<

return true

end

 

local ballName = getItemAttribute(item.uid, "poke")

local btype = getPokeballType(item.itemid)

local usando = pokeballs[btype].use

 

local effect = pokeballs[btype].effect

if not effect then

effect = 21

end

 

unLock(item.uid) --alterado v1.8

 

if item.itemid == usando then

 

if getPlayerStorageValue(cid, 990) == 1 then -- GYM

doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")

return true

end

if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then --alterado v1.6

if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then

BackTeam(cid)

end

end

if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then

doPlayerSendCancel(cid, "You can't do that while is controling a mind")

return true --alterado v1.5

end

if #getCreatureSummons(cid) <= 0 then

if isInArray(pokeballs[btype].all, item.itemid) then

doTransformItem(item.uid, pokeballs[btype].off)

doItemSetAttribute(item.uid, "hp", 0)

doPlayerSendCancel(cid, "This pokemon is fainted.")

return true

end

end

 

local cd = getCD(item.uid, "blink", 30)

if cd > 0 then

setCD(item.uid, "blink", 0)

end

 

local z = getCreatureSummons(cid)[1]

 

if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then

return true

end

doReturnPokemon(cid, z, item, effect)

 

elseif item.itemid == pokeballs[btype].on then

 

if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then

doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")

return TRUE

end

 

local thishp = getItemAttribute(item.uid, "hp")

 

if thishp <= 0 then

if isInArray(pokeballs[btype].all, item.itemid) then

doTransformItem(item.uid, pokeballs[btype].off)

doItemSetAttribute(item.uid, "hp", 0)

doPlayerSendCancel(cid, "This pokemon is fainted.")

return true

end

end

 

local pokemon = getItemAttribute(item.uid, "poke")

 

if not pokes[pokemon] then

return true

end

 

----------------------- Sistema de nao poder carregar mais que 3 pokes lvl baixo e + q 1 poke de lvl medio/alto ---------------------------------

if not isInArray({5, 6}, getPlayerGroupId(cid)) then

local balls = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

local low = {}

local lowPokes = {"Rattata", "Caterpie", "Weedle", "Oddish", "Pidgey", "Paras", "Poliwag", "Bellsprout", "Magikarp", "Hoppip", "Sunkern"}

if #balls >= 1 then

for _, uid in ipairs(balls) do

local nome = getItemAttribute(uid, "poke")

if not isInArray(lowPokes, pokemon) and nome == pokemon then

return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry two pokemons equals!")

else

if nome == pokemon then

table.insert(low, nome)

end

end

end

end

if #low >= 3 then

return doPlayerSendTextMessage(cid, 27, "Sorry, but you can't carry more than three pokemons equals of low level!")

end

end

---------------------------------------------------------------------------------------------------------------------------------------------------

 

local x = pokes[pokemon]

local boost = getItemAttribute(item.uid, "boost") or 0

 

if getPlayerLevel(cid) < (x.level+boost) then

doPlayerSendCancel(cid, "You need level "..(x.level+boost).." to use this pokemon.")

return true

end

 

---------------------------- Sistema pokes de clan --------------------------------------

local shinysClan = {

["Shiny Fearow"] = {4, "Wingeon"},

["Shiny Flareon"] = {1, "Volcanic"},

["Shiny Vaporeon"] = {2, "Seavel"},

["Shiny Jolteon"] = {9, "Raibolt"},

["Shiny Hypno"] = {7, "Psycraft"},

["Shiny Golem"] = {3, "Orebound"},

["Shiny Vileplume"] = {8, "Naturia"},

["Shiny Nidoking"] = {5, "Malefic"},

["Shiny Hitmontop"] = {6, "Gardestrike"}, --alterado v1.4

}

 

if shinysClan[pokemon] and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then --alterado v1.9 \/

if getPlayerClanNum(cid) ~= shinysClan[pokemon][1] then

doPlayerSendCancel(cid, "You need be a member of the clan "..shinysClan[pokemon][2].." to use this pokemon!")

return true

elseif getPlayerClanRank(cid) ~= 5 then

doPlayerSendCancel(cid, "You need be atleast rank 5 to use this pokemon!")

return true

end

end

--------------------------------------------------------------------------------------

 

doSummonMonster(cid, pokemon)

 

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then return true end

 

------------------------passiva hitmonchan------------------------------

if isSummon(pk) then --alterado v1.8 \/

if pokemon == "Shiny Hitmonchan" or pokemon == "Hitmonchan" then

if not getItemAttribute(item.uid, "hands") then

doSetItemAttribute(item.uid, "hands", 0)

end

local hands = getItemAttribute(item.uid, "hands")

doSetCreatureOutfit(pk, {lookType = hitmonchans[pokemon][hands].out}, -1)

end

end

-------------------------------------------------------------------------

---------movement magmar, jynx-------------

if EFFECTS[getCreatureName(pk)] then

markPosEff(pk, getThingPos(pk))

sendMovementEffect(pk, EFFECTS[getCreatureName(pk)], getThingPos(pk))

end

--------------------------------------------------------------------------

 

if getCreatureName(pk) == "Ditto" or getCreatureName(pk) == "Shiny Ditto" then --edited

 

local left = getItemAttribute(item.uid, "transLeft")

local name = getItemAttribute(item.uid, "transName")

 

if left and left > 0 then

setPlayerStorageValue(pk, 1010, name)

doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)

addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))

doItemSetAttribute(item.uid, "transBegin", os.clock())

else

setPlayerStorageValue(pk, 1010, getCreatureName(pk) == "Ditto" and "Ditto" or "Shiny Ditto") --edited

end

end

 

if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end

 

doCreatureSetLookDir(pk, 2)

 

adjustStatus(pk, item.uid, true, true, true)

doAddPokemonInOwnList(cid, pokemon)

 

doTransformItem(item.uid, item.itemid+1)

 

local pokename = getPokeName(pk) --alterado v1.7

 

local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

 

doSendMagicEffect(getCreaturePosition(pk), effect)

 

if useOTClient then

doPlayerSendCancel(cid, '12//,show') --alterado v1.7

end

 

else

 

doPlayerSendCancel(cid, "This pokemon is fainted.")

 

end

 

if useKpdoDlls then

doUpdateMoves(cid)

end

return true

end

 

 

Editado Fevereiro 21 por Eduzinhonho

BluesterB
21 de fevereiro de 2016 às 11:13
Melhor resposta

Deixe aquela linha assim:

 

 

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1

or getPlayerStorageValue(cid, 75846) >= 1 then --alterado v1.9 <<

return true

end

 

 

e teste logo após.

É que estou pelo celular :v, mas não tem erro cara, só deixar essa parte que você mandou do jeito que mandei ↑

Editado Fevereiro 21 por Bluester

DuhisbackD
21 de fevereiro de 2016 às 11:20

Deixe aquela linha assim:

 

 

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1

or getPlayerStorageValue(cid, 75846) >= 1 then --alterado v1.9 <<

return true

end

 

 

e teste logo após.

É que estou pelo celular :v, mas não tem erro cara, só deixar essa parte que você mandou do jeito que mandei ↑

tá tranquilo pow fico muito agradecido mesmo por tar tentando min ajudar tem problema não e estou fazendo igual vc manda vou testar e te falo

Deixe aquela linha assim:

 

 

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1

or getPlayerStorageValue(cid, 75846) >= 1 then --alterado v1.9 <<

return true

end

 

 

e teste logo após.

É que estou pelo celular :v, mas não tem erro cara, só deixar essa parte que você mandou do jeito que mandei ↑

 

Erro solucionado já agora deu certo tenho outro problema será que pode min ajudar?

 

tipo quando o server cai, se tiver montado na bike quando volta fica com um outfit estranho lá mostrando as fotos de uns poke e dai no meu server tem o sistema de não deslogar enquanto tiver na bike será que tem como você arrumar o script pra quando o serv cair voltar ao normal e quando tiver on que for deslogar se tiver na bike não permitir deslogar?

BluesterB
21 de fevereiro de 2016 às 12:22

tá tranquilo pow fico muito agradecido mesmo por tar tentando min ajudar tem problema não e estou fazendo igual vc manda vou testar e te falo

 

 

Erro solucionado já agora deu certo tenho outro problema será que pode min ajudar?

 

tipo quando o server cai, se tiver montado na bike quando volta fica com um outfit estranho lá mostrando as fotos de uns poke e dai no meu server tem o sistema de não deslogar enquanto tiver na bike será que tem como você arrumar o script pra quando o serv cair voltar ao normal e quando tiver on que for deslogar se tiver na bike não permitir deslogar?

Não seria mais fácil arrumar para deslogar na bike, e continuar na bike ao logar ?
DuhisbackD
22 de fevereiro de 2016 às 23:08

Não seria mais fácil arrumar para deslogar na bike, e continuar na bike ao logar ?

 

mais se eu deixar desativado ai fica assim quando cai o serve por exemplo ou quando eu fecho ou deslogo caso o player esteja montado

29nxkza.jpg

Não seria mais fácil arrumar para deslogar na bike, e continuar na bike ao logar ?

 

como que eu faço pra deslogar e quando logar ficar com o outfit da bike caso esteja montado?

se tiver a solução fala ai e se alguém que esteja lendo esse post agora saiba fale como que faço para eu minimizar mais um problema no meu ot

Editado Fevereiro 21 por Eduzinhonho

BluesterB
23 de fevereiro de 2016 às 06:05

 

mais se eu deixar desativado ai fica assim quando cai o serve por exemplo ou quando eu fecho ou deslogo caso o player esteja montado

29nxkza.jpg

 

 

como que eu faço pra deslogar e quando logar ficar com o outfit da bike caso esteja montado?

se tiver a solução fala ai e se alguém que esteja lendo esse post agora saiba fale como que faço para eu minimizar mais um problema no meu ot

Quando eu chegar em casa eu te ajudo. :D
DuhisbackD
24 de fevereiro de 2016 às 07:18

Quando eu chegar em casa eu te ajudo. :D

 

Tranquilo vou aguardar amigo

Eu consegui resolver esse outro problema é bem facil

 

Vai em data>creaturescripts>scripts>login.luae procura por \/

 

 

     elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike
        doChangeSpeed(cid, -getCreatureSpeed(cid))
        doChangeSpeed(cid, getPlayerStorageValue(cid, 5700))  --alterado v1.8
        if getPlayerSex(cid) == 1 then
           doSetCreatureOutfit(cid, {lookType = 1787}, -1)
        else
           doSetCreatureOutfit(cid, {lookType = 1619}, -1)
        end
BluesterB
24 de fevereiro de 2016 às 08:03

 

 

Tranquilo vou aguardar amigo

 

Eu consegui resolver esse outro problema é bem facil

 

Vai em data>creaturescripts>scripts>login.luae procura por \/

 

     elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike
        doChangeSpeed(cid, -getCreatureSpeed(cid))
        doChangeSpeed(cid, getPlayerStorageValue(cid, 5700))  --alterado v1.8
        if getPlayerSex(cid) == 1 then
           doSetCreatureOutfit(cid, {lookType = 1787}, -1)
        else
           doSetCreatureOutfit(cid, {lookType = 1619}, -1)
        end
Sim, é isso mesmo.
1 mês depois...
DanihcvD
20 de março de 2016 às 01:24

Tópico movido para dúvidas / pedidos resolvidos.

1 ano depois...
FrenviusF
29 de novembro de 2017 às 14:16
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.