Ir para conteúdo
  • 0

Bike


StrikersBR12

Pergunta

Posts Recomendados

  • 0
1 minuto atrás, Marshmello disse:

Mano é só colocar Um item da Nike com noMovible e fazer um transformItem

como faço isso , '-'

5 minutos atrás, Renzyx disse:

Também como nosso amigo marshmello citou ali em cima, você pode fazer de duas maneiras, duas delas são:

 


doTransformItem

e


onMoveItem

o onMoveItem, já postei o script acima, basta você testar já possuindo a function onMoveItem nas sources, que é provavél que você deva ter, eu acredito que sim.

olha compilei na source , porem se eu tento joga a bike na backpack o serv crasha

9 minutos atrás, Marshmello disse:

Mano é só colocar Um item da Nike com noMovible e fazer um transformItem

@Marshmello pode me ajudar ? fazendo um script dotransform?

Link para o comentário
Compartilhar em outros sites

  • 0
49 minutos atrás, Marshmello disse:

Me de os id's do item da bike  com ela movivel e não movivel e sua script da bike pf

bikes moviveis

 

Bike normal - 12774

 

Bike Leaf - 12937

 

Bike Fire - 12938

 

Bike Water - 12936

 

Bike Thunder - 12935

 

bikes não moviveis

 

Bike - 16232

 

Bike Leaf - 16235

 

Bike Fire - 16236

 

Bike Water - 16234

 

Bike Thunder - 16233

script bike.lua

bike.lua bikefire.lua bikeleaf.lua bikethunder.lua bikewater.lua

@Marshmello tudo ae

Link para o comentário
Compartilhar em outros sites

  • 0
function onUse(cid, item, fromPosition, itemEx, toPosition) 
local sBike = 12774 
local t = {
[12774] = {article='a', name='bike', text='Vou montar na bike!', dtext='Vou sair da bike!', s=5700, condition=bikeCondition, nonMoveable = 16232},
} 
local premium = false 
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 
if not isPremium(cid) then
doPlayerSendCancel(cid, "Vc nao é premium, Vaza.")
return true
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 not getPlayerItemCount(cid, item.itemid) then
		return false
	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)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você montou na ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOn(cid,1100)
doTransformItem(item,uid, r.nonMoveable)
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 2518, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
setPlayerStorageValue(cid, 7200, 1)
else
doSetCreatureOutfit(cid, {lookType = 2517, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
setPlayerStorageValue(cid, 7200, 1)
end 

elseif getPlayerStorageValue(cid, s) == 1 then
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você saiu da ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOff(cid)
setPlayerStorageValue(cid, 7200, -1)
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 

Pronto, só quando for registrar novas bikes por lá em nonMoveable o id dela.

Link para o comentário
Compartilhar em outros sites

  • 0
2 horas atrás, Ceetros disse:

function onUse(cid, item, fromPosition, itemEx, toPosition) 
local sBike = 12774 
local t = {
[12774] = {article='a', name='bike', text='Vou montar na bike!', dtext='Vou sair da bike!', s=5700, condition=bikeCondition, nonMoveable = 16232},
} 
local premium = false 
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 
if not isPremium(cid) then
doPlayerSendCancel(cid, "Vc nao é premium, Vaza.")
return true
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 not getPlayerItemCount(cid, item.itemid) then
		return false
	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)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você montou na ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOn(cid,1100)
doTransformItem(item,uid, r.nonMoveable)
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 2518, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
setPlayerStorageValue(cid, 7200, 1)
else
doSetCreatureOutfit(cid, {lookType = 2517, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
setPlayerStorageValue(cid, 7200, 1)
end 

elseif getPlayerStorageValue(cid, s) == 1 then
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você saiu da ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOff(cid)
setPlayerStorageValue(cid, 7200, -1)
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 

Pronto, só quando for registrar novas bikes por lá em nonMoveable o id dela.

por nonmoveable aonde é isso? creaturescripts? source?

Link para o comentário
Compartilhar em outros sites

  • 0

Cara começa a prestar mais atenção....

 

[12774] = {article='a', name='bike', text='Vou montar na bike!', dtext='Vou sair da bike!', s=5700, condition=bikeCondition, nonMoveable = 16232},

 

Link para o comentário
Compartilhar em outros sites

  • 0
3 horas atrás, Marshmello disse:

Cara começa a prestar mais atenção....

 


[12774] = {article='a', name='bike', text='Vou montar na bike!', dtext='Vou sair da bike!', s=5700, condition=bikeCondition, nonMoveable = 16232},

 

[18/09/2019 22:17:07] [Error - Action Interface] 
[18/09/2019 22:17:07] datapack/actions/scripts/bike.lua:onUse
[18/09/2019 22:17:07] Description: 
[18/09/2019 22:17:07] (luaDoTransformItem) Item not found

Link para o comentário
Compartilhar em outros sites

  • 0
function onUse(cid, item, fromPosition, itemEx, toPosition) 
local sBike = 12774 
local t = {
[12774] = {article='a', name='bike', text='Vou montar na bike!', dtext='Vou sair da bike!', s=5700, condition=bikeCondition, nonMoveable = 16232, movable = 12774 },
} 
local premium = false 
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 
if not isPremium(cid) then
doPlayerSendCancel(cid, "Vc nao é premium, Vaza.")
return true
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 not getPlayerItemCount(cid, item.itemid) then
		return false
	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)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você montou na ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOn(cid,1100)
doTransformItem(itemEx,uid, r.nonMoveable)
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 2518, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
setPlayerStorageValue(cid, 7200, 1)
else
doSetCreatureOutfit(cid, {lookType = 2517, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
setPlayerStorageValue(cid, 7200, 1)
end 

elseif getPlayerStorageValue(cid, s) == 1 then
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você saiu da ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOff(cid)
setPlayerStorageValue(cid, 7200, -1)
doTransformItem(itemEx,uid, r.movable)
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 

Modifiquei umas linhas na Scripts do ceetros , assim deve funcionar

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...