[Encerrado] [Pedido] Bike System

Sakura777
em Tópicos Sem Resposta
  • 1
  • 2

Sakura777

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/10/12Posts: 19

Será que alguém pode fazer 1 detalhe para mim com essa script de bike? tipo quero que possam usa ela apenas quando ela estiver no slot na pokebag, porque ela se jogar no chão e varios clicarem todos ficam montado na bike :\ agradeço quem conseguir fazer isso para mim

 

 

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

ta eh um item normal? q tem q ficar dentro da bag? ou ele VAI no lugar da bag?

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Sakura777

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/10/12Posts: 19

ta eh um item normal? q tem q ficar dentro da bag? ou ele VAI no lugar da bag?

 

Não ele vai fica dentro da bag, exemplo eu fiz 1 slot sepossivel eu quero que ela só funcione se eu por ela no local exemplo

 

 

97994387.png

 

 

 

no slot acima do cap, é onde eu ponho a bike, porem ela usa em qualquer luga se joga no chão e da use ja monta na bike, se possivel quero ajdua de alguem que faça ela pode ser usada só se por no slot acima do cap ali, ou se por dentro da pokepag.

Session Start

cleber.16mb.com
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 25/04/12Posts: 752Gênero: Masculino

tenta colocar isso

PEGA DNV, tava slot errado '-'

 

 

 

 

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

Sakura777

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/10/12Posts: 19

tenta colocar isso

PEGA DNV, tava slot errado '-'

 

 

 

 

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

 

Malz tipo, continua quase a mesma coisa exemplo, essa bike script está configurada para quest bike, quando o player pega a bike ela via para 1 slot, mas tipo, se o player joga a bike no chão e clica monta na bike, no caso eu iria querer por a bike para vender no shop quando ela chega na bag se o player joga no chão e tenta clicar vai falar, precisa esta no slot correto para usa a bike. Sendo que a unica solução que tive foi na quest só pega a bike se o slot estive vazio e deixei ela imovel quando ela cai no slot ja era nao tem ais como remove, ams ano quero deixa ela como quest quero vende no shope o player fazer negocios com a bike e esse tipo de coisa, fazer oque ele bem entender.,desde que nao dê pra usa ela no chão e monte de player clica e sair usando bike por ae¬¬. se puder me ajuda fico grata T_____T Leva +rep pq ano quebra dedo

Session Start

cleber.16mb.com
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 25/04/12Posts: 752Gênero: Masculino

Não tem como eu testar aqui, mas vamo tentanto '-'

 

 

 

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == sBike.uid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

Sakura777

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/10/12Posts: 19

Não tem como eu testar aqui, mas vamo tentanto '-'

 

 

 

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == sBike.uid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

Agora ela não da use em lugar nenhum. T_____________T

Session Start

cleber.16mb.com
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 25/04/12Posts: 752Gênero: Masculino

Coloquei agora itemid / era uid e,e

 

 

 

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == sBike.itemid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

Sakura777

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/10/12Posts: 19

Coloquei agora itemid / era uid e,e

 

 

 

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == sBike.itemid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

O problema persistiu D::D:: T___T nao da use em nenhum lugar

 

Edit: QUando da use

 

[28/10/2012 14:17:08] [Error - Action Interface]

[28/10/2012 14:17:08] data/actions/scripts/Bike.lua:onUse

[28/10/2012 14:17:08] Description:

[28/10/2012 14:17:08] data/actions/scripts/Bike.lua:31: attempt to index local 'sBike' (a number value)

[28/10/2012 14:17:08] stack traceback:

[28/10/2012 14:17:08] data/actions/scripts/Bike.lua:31: in function <data/actions/scripts/Bike.lua:1>

Sakura777

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/10/12Posts: 19

Só uma pergunta, aquele 5247 é o ID da bike? G.G

 

Ou é storage?

 

 

[2547] ID da bike

Session Start

cleber.16mb.com
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 25/04/12Posts: 752Gênero: Masculino

A mano, já vi, eu pus pra usar no lugar do colar, pensei que AMMO éra emcima do cap o.O vou ver se acho o nome certo daquilo g,g

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

ta ae...

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

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

return doPlayerSendCancel(cid, "You have to put the bike in the correct slot!")

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

@Cleberadm

vc tinha feito certo.. soh q tu boto para caso a bike estivese no slot de ammo mandase a msg q esta no lugar errado ;x

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then
doPlayerSendCancel("Não está no slot correto")
return true
end

deveria ser..

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid ~= item.uid then
doPlayerSendCancel("Não está no slot correto")
return true
end

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Sakura777

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/10/12Posts: 19

ta ae...

 

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

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

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

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

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

return doPlayerSendCancel(cid, "You have to put the bike in the correct slot!")

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

@Cleberadm

vc tinha feito certo.. soh q tu boto para caso a bike estivese no slot de ammo mandase a msg q esta no lugar errado ;x

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then
doPlayerSendCancel("Não está no slot correto")
return true
end

deveria ser..

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid ~= item.uid then
doPlayerSendCancel("Não está no slot correto")
return true
end

 

 

@Slicer *----------------------* Muito obrigado muito mesmo leva + rep essa foi perfeita

 

@Cleberadm: Muito obrigado por tenta me ajuda foi quase la

  • 1
  • 2