Ir para conteúdo

Featured Replies

Postado

Queria que alguém colocasse uma função nessa script que quando o player estive usando a bike não poderá usar Fly, Ride ou Surf 

tentei assim mais não deu::

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

                   doPlayerSendCancel(cid, "Voce nao pode usar a bike enquanto estiver no ride/fly/surf.")
return true
end

 
bike.lua

local config =


{
velocidadeDaSuaBike = 999, -- A volocidade da bike (1-9)
outfitMale = 1787, -- Outfit male
outfitFemale = 1618, -- Outfit female
storageValue = 5602, -- Storage Para a bike
}

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

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).."")
doSendMagicEffect(getThingPos(cid), 18)
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)
doSendMagicEffect(getThingPos(cid), 18)
doRemoveCondition(cid, CONDITION_OUTFIT)
doRegainSpeed(cid)
end

return true
end

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

Resolvido por luanluciano93

Ir para solução
  • Respostas 19
  • Visualizações 658
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Tenta usar essa script aki:

  • luanluciano93
    luanluciano93

    Depois da primeira linha da função ... Function ... Você coloca isso dentro dela: if getPlayerStorageValue(cid, 5602) > 0 then doPlayerSendCancel(cid, "Voce nao pode usar a bike enquanto esti

  • luanluciano93
    luanluciano93

    @xWhiteWolf, no script de advance tem essa função doRegainSpeed(cid), acho que é isso, é só ele retirar esa linha: doRegainSpeed(cid) 

Postado

Tenta usar essa script aki:


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)
local t = {text='Subindo na bike!', dtext='Desecendo da, bike!', s=9700, speed = 1000}

--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 then
return doPlayerSendCancel(cid, "Voce nao pode usar a bike enquanto estiver no ride/fly/surf.")
end

if getPlayerStorageValue(cid, t.s) <= 0 then
doSendMagicEffect(pos, 173)
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 = 1581}, -1)
else
doSetCreatureOutfit(cid, {lookType = 1581}, -1)
end
else
doSendMagicEffect(pos, 173)
doCreatureSay(cid, t.dtext, 19)
--doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.')
BikeSpeedOff(cid, t)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end

Meus Contatos!

 

Minhas Funções:

 

               Skype: TsplayerT

         Facebook: TakaFukushii

          YouTube: ADoseDupla

           Twitter: @_Splayer_

 

 

 

 

 

 

 

                             Mapper:▓▓▓▓▓▓▓▓▓▓ 97%

     Programmer:▓▓▓▓▓▒▒▒▒▒ 45%

             Scripter:▓▓▓▓▓▓▓▓▓▒ 83%

              Spriter:▓▓▓▓▓▓▒▒▒▒ 57%

    Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99%

        Ot Creator:▓▓▓▓▓▓▓▒▒▒71%

Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%

 

Postado

tenta ai

 

local config =

{
velocidadeDaSuaBike = 999, -- A volocidade da bike (1-9)
outfitMale = 1787, -- Outfit male
outfitFemale = 1618, -- Outfit female
storageValue = 5602, -- Storage Para a bike
}

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

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).."")
doSendMagicEffect(getThingPos(cid), 18)
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)
doSendMagicEffect(getThingPos(cid), 18)
doRemoveCondition(cid, CONDITION_OUTFIT)

ifplayer user(cancel)
doRegainSpeed(cid)
end

return true
end

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

ca.png?1422745283

 

CONQUISTASdesigner-king.png   Designer.png    

 

Postado
  • Autor

tenta ai

 

local config =

{

velocidadeDaSuaBike = 999, -- A volocidade da bike (1-9)

outfitMale = 1787, -- Outfit male

outfitFemale = 1618, -- Outfit female

storageValue = 5602, -- Storage Para a bike

}

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

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).."")

doSendMagicEffect(getThingPos(cid), 18)

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)

doSendMagicEffect(getThingPos(cid), 18)

doRemoveCondition(cid, CONDITION_OUTFIT)

ifplayer user(cancel)

doRegainSpeed(cid)

end

return true

end

obrigado por tenta mais não funcionou da um erro sobre ifplayeruse

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