Ir para conteúdo

Featured Replies

Postado

Bom eu queria que quando o player estivesse com a bike ativada não pudesse remove-lá até desativa-lá, só que quando ele puxa o item da bike e joga no chão, apenas aparece a mensagem e não bloqueia a ação. Alguém poderia me ajudar a finalizar o sistema?!

Data/actions/scripts/bike.xml:

Citar

local config =
{
    velocidadeDaSuaBike = 5000, -- Velocidade da bike coloquei igual o do OtPokemon 
    outfitMale = 3177, -- Outfit MALE
    outfitFemale = 3178, -- Outfit FEMALE
    storageValue = 243656, -- Não mude
}
 
function onUse(cid, item, itemEx, fromPosition, toPosition)

    if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_RING).uid then
        doPlayerSendCancel(cid, "Você deve colocar sua bike no local correto.") -- Mensagem que da ao tentar usar a bike fora do slot (by: Lukas)
    return TRUE
end

    if getPlayerStorageValue(cid, 17001) > 0 or getPlayerStorageValue(cid, 17000) > 0 or getPlayerStorageValue(cid, 63215) > 0 then
        doPlayerSendCancel(cid, "Você não pode usar bike em situações especiais.")
    return true
end
 
    if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end
        if getPlayerStorageValue(cid, config.storageValue) <= 0 then
            local a = {lookType = config.outfitMale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
            local b = {lookType = config.outfitFemale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
            setPlayerStorageValue(cid, 3624, ""..getPlayerStamina(cid).."")
            doChangeSpeed(cid, -getCreatureSpeed(cid))
            doChangeSpeed(cid, config.velocidadeDaSuaBike)
            setPlayerStorageValue(cid, config.storageValue, 1)        
            if getPlayerSex(cid) == 0 then
                doSetCreatureOutfit(cid, b, -1)
            else
                doSetCreatureOutfit(cid, a, -1)
            end
        else
            setPlayerStorageValue(cid, config.storageValue, 0)
            doRemoveCondition(cid, CONDITION_OUTFIT)
            doRegainSpeedLevel(cid)
       end
    return true
end

Data/actions:

Citar

<action itemid="22081" event="script" value="bikewater.lua"/>

Data/movements/scripts:

Citar

local storage = 243656 -- Coloque a Storage Que Controla o Sistema de Bike
function onDeEquip(cid, item, slot)
    if getPlayerStorageValue(cid, storage) > 0 then
        doPlayerSendCancel(cid, "Voce nao pode remover a bike enquanto esta montado.")
    return false
    end
end
 

Data/movements:

Citar

<movevent type="Equip" itemid="14440;22080;22081;22082;22083;" slot="ring" event="script" value="bikemove.lua"/>
     <movevent type="DeEquip" itemid="14440;22080;22081;22082;22083;" slot="ring" event="script" value="bikemove.lua"/>

 

bike erro.png

  • 2 weeks later...
Postado
local storage = 243656 -- Coloque a Storage Que Controla o Sistema de Bike
function onDeEquip(cid, item, slot)

if getPlayerStorageValue(cid, storage) = 1 then
doPlayerSendCancel(cid, "Voce nao pode remover a bike enquanto esta montado.")
return false
end
end

 

giphy.gif

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.6k

Informação Importante

Confirmação de Termo