coloca isso ae no script...
doSetItemAttribute(itemEx.uid, "unique", cid)
lembrando q isso soh vai deixar a bike unique depois q o player usar ela pela 1* vez...
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

coloca isso ae no script...
doSetItemAttribute(itemEx.uid, "unique", cid)
lembrando q isso soh vai deixar a bike unique depois q o player usar ela pela 1* vez...
tb to querendo isto, pode colocar em qualquer parte do script?
Editado Novembro 10 por guromk
Não funcionou aqui, mesmo usando o item varias vezes, ainda da pra joga-lo no chão, assim com uma só bike todos os player do jogo pode usa-la..
function onUse(cid, item, fromPosition, itemEx, toPosition)
local sBike = 5701
local t = {
[9690] = {article='a', name='bike', text='Mount, bike!', dtext='Demount, bike!', s=5700, condition=bikeCondition},
} --mude o [ ] pro id do item q vai usar a bike...
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 #getCreatureSummons(cid) >= 1 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
doSetItemAttribute(itemEx.uid, "unique", cid)
if not isPremium(cid) then --alterei aki!
doPlayerSendCancel(cid, "You can't use bike without be a premium player.")
return true
end
if getPlayerStorageValue(cid, s) <= 0 then
doSendMagicEffect(pos, 177)
doCreatureSay(cid, r.text, 19)
setPlayerStorageValue(cid, s, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOn(cid,500)
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 1394}, -1)
else
doSetCreatureOutfit(cid, {lookType = 1393}, -1)
end
elseif getPlayerStorageValue(cid, s) == 1 then
doSendMagicEffect(pos, 177)
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted ' .. r.article .. ' '.. r.name .. '.')
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
será que coloquei no lugar errado?
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

info
Grupo: Campones
Registrado: 22/10/12
Posts: 31
Reputação: +1
Bom, quero deixar minha bike um item unique..tipo igual aos pokemons iniciais. depois que o player tiver a bike não pode desfazer dela se jogar no chão vai pro DP, +/- isso.
o script dela :
function onUse(cid, item, fromPosition, itemEx, toPosition)
local sBike = 5701
local t = {
[9690] = {article='a', name='bike', text='Mount, bike!', dtext='Demount, bike!', s=5700, condition=bikeCondition},
} --mude o [ ] pro id do item q vai usar a bike...
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 #getCreatureSummons(cid) >= 1 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 not isPremium(cid) then --alterei aki!
doPlayerSendCancel(cid, "You can't use bike without be a premium player.")
return true
end
if getPlayerStorageValue(cid, s) <= 0 then
doSendMagicEffect(pos, 177)
doCreatureSay(cid, r.text, 19)
setPlayerStorageValue(cid, s, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOn(cid,500)
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 1394}, -1)
else
doSetCreatureOutfit(cid, {lookType = 1393}, -1)
end
elseif getPlayerStorageValue(cid, s) == 1 then
doSendMagicEffect(pos, 177)
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted ' .. r.article .. ' '.. r.name .. '.')
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