Não estou conseguindo cancelar o efeito, o mesmo fica setado no char e só sai quando reloga.. @upalord
Pronto:
local efeito = 2
local config =
{
velocidadeDaSuaMoto = 6000, -- Velocidade da Moto coloquei igual o do OtPokemon
outfitMale = 1985, -- Outfit MALE
outfitFemale = 1985, -- Outfit FEMALE
storageValue = 243656, -- Não mude
}
function markPosEffMoto(sid, pos)
if not isCreature(sid) then return end
setPlayerStorageValue(sid, 26547, pos.x)
setPlayerStorageValue(sid, 26548, pos.y)
setPlayerStorageValue(sid, 26549, pos.z)
end
function getMarkedPosEffMoto(sid)
if not isCreature(sid) then return end
local xx = getPlayerStorageValue(sid, 26547)
local yy = getPlayerStorageValue(sid, 26548)
local zz = getPlayerStorageValue(sid, 26549)
return {x = xx, y = yy, z = zz}
end
function sendMoveEffectMoto(cid, effect, pos)
if isCreature(cid) then
if pos then
doSendMagicEffect(pos, effect)
else
doSendMagicEffect(getThingPos(cid), effect)
end
end
end
function sendMovementEffectMoto(cid, eff, pos)
if isCreature(cid) and getPlayerStorageValue(cid, config.storageValue) > 0 then
local nPos = getMarkedPosEffMoto(cid)
if pos.x ~= nPos.x or pos.y ~= nPos.y then
sendMoveEffectMoto(cid, eff, nPos)
markPosEffMoto(cid, getThingPos(cid))
end
addEvent(sendMovementEffectMoto, 100, cid, eff, getThingPos(cid))
end
end
function onUse(cid, item, itemEx, fromPosition, toPosition)
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_RING).uid then
doPlayerSendCancel(cid, "Você deve colocar sua moto no local correto.") -- Mensagem que da ao tentar usar a Moto 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 a sua moto 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.velocidadeDaSuaMoto)
setPlayerStorageValue(cid, config.storageValue, 1)
markPosEffMoto(cid, getThingPos(cid))
sendMovementEffectMoto(cid, efeito, getThingPos(cid))
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)
--doSendMagicEffect(cid, -1) -----??? ARRUME ISSO RAPAZ, NÂO EXISTE EFEITO -1
end
return true
end
10 horas atrás, XZero disse:Pronto:
local efeito = 2
local config =
{
velocidadeDaSuaMoto = 6000, -- Velocidade da Moto coloquei igual o do OtPokemon
outfitMale = 1985, -- Outfit MALE
outfitFemale = 1985, -- Outfit FEMALE
storageValue = 243656, -- Não mude
}
function markPosEffMoto(sid, pos)
if not isCreature(sid) then return end
setPlayerStorageValue(sid, 26547, pos.x)
setPlayerStorageValue(sid, 26548, pos.y)
setPlayerStorageValue(sid, 26549, pos.z)
endfunction getMarkedPosEffMoto(sid)
if not isCreature(sid) then return end
local xx = getPlayerStorageValue(sid, 26547)
local yy = getPlayerStorageValue(sid, 26548)
local zz = getPlayerStorageValue(sid, 26549)
return {x = xx, y = yy, z = zz}
endfunction sendMoveEffectMoto(cid, effect, pos)
if isCreature(cid) then
if pos then
doSendMagicEffect(pos, effect)
else
doSendMagicEffect(getThingPos(cid), effect)
end
end
endfunction sendMovementEffectMoto(cid, eff, pos)
if isCreature(cid) and getPlayerStorageValue(cid, config.storageValue) > 0 then
local nPos = getMarkedPosEffMoto(cid)if pos.x ~= nPos.x or pos.y ~= nPos.y then
sendMoveEffectMoto(cid, eff, nPos)
markPosEffMoto(cid, getThingPos(cid))
end
addEvent(sendMovementEffectMoto, 100, cid, eff, getThingPos(cid))
end
end
function onUse(cid, item, itemEx, fromPosition, toPosition)if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_RING).uid then
doPlayerSendCancel(cid, "Você deve colocar sua moto no local correto.") -- Mensagem que da ao tentar usar a Moto fora do slot (by: Lukas)
return true
endif getPlayerStorageValue(cid, 17001) > 0 or getPlayerStorageValue(cid, 17000) > 0 or getPlayerStorageValue(cid, 63215) > 0 then
doPlayerSendCancel(cid, "Você não pode usar a sua moto 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.velocidadeDaSuaMoto)
setPlayerStorageValue(cid, config.storageValue, 1)
markPosEffMoto(cid, getThingPos(cid))
sendMovementEffectMoto(cid, efeito, getThingPos(cid))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)
--doSendMagicEffect(cid, -1) -----??? ARRUME ISSO RAPAZ, NÂO EXISTE EFEITO -1
end
return true
end
Um simples getPlayerStorageValue(cid, config.storageValue) > 0 then resolvia e eu me matando.
Obrigado lek, tmj!