Seguinte pessoal, eu uso esse fly system aqui:
function onSay(cid, words, param)local pokes = {
["Dragon"] = {lookType = 216, speed = 500},
}
if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 62314) <= 0 then
doPlayerSendCancel(cid, "You need a pokemon to fly.")
end
if getPlayerStorageValue(cid, 62314) <= 0 and not pokes[getCreatureName(getCreatureSummons(cid)[1])] then
return doPlayerSendCancel(cid, "This pokemon can't fly.")
end
if getPlayerStorageValue(cid, 62314) <= 0 then
doSetCreatureOutfit(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])], -1)
doChangeSpeed(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])].speed)
setPlayerStorageValue(cid, 61263, getCreatureMaxHealth(getCreatureSummons(cid)[1]))
setPlayerStorageValue(cid, 61262, getCreatureHealth(getCreatureSummons(cid)[1]))
setPlayerStorageValue(cid, 62314, 1)
registerCreatureEvent(cid, "LogoutPoke")
doCreatureSay(cid, "Let's fly, "..getCreatureName(getCreatureSummons(cid)[1]), 1)
doRemoveCreature(getCreatureSummons(cid)[1])
local ppos = getCreaturePos(cid)
local newpos = {x=ppos.x, y=ppos.y, z = 0}
doCreateTile(460, newpos)
doTeleportThing(cid, newpos)
for i = 1,8 do
doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i)
end
elseif getPlayerStorageValue(cid, 62314) >= 1 then
local ppos = getCreaturePosition(cid)
p = true
for i = 1,17 do
if getTileThingByPos({x=ppos.x, y=ppos.y, z=ppos.z+i}).itemid ~= 0 and not isWalkable({x=ppos.x, y=ppos.y, z=ppos.z+i}) then
p = false
break
end
if isWalkable({x=ppos.x, y=ppos.y, z=ppos.z+i}) then
l = ppos.z + i
break
end
end
if not p or getTileThingByPos({x=ppos.x, y=ppos.y, z=l}).itemid == 4820 then
return doPlayerSendCancel(cid, "You can't down in there.")
end
for i = 1,8 do
doRemoveTile(getPosDirs(getCreaturePosition(cid), i))
end
setPlayerStorageValue(cid, 62314, 0)
doTeleportThing(cid, {x=ppos.x, y=ppos.y, z=l})
doRemoveTile(ppos)
local item = getPokeOutLive(cid)[1]
pk = doSummonCreature(getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), getThingPosition(cid))
doConvinceCreature(cid, pk)
doCreatureSay(cid, "I'm tired of fly, "..getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), 1)
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
setCreatureMaxHealth(pk, getPlayerStorageValue(cid, 61263))
doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61263))
doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61262)-getPlayerStorageValue(cid, 61263))
doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid))
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return TRUE
end
.. que foi postado aqui memso no fórum.
Mas eu queria fazer uma modificação nele, por que nesse fly, você pode tar em qualquer andar, que quando usar o !fly vai pra z= 0.
Ou seja, o cara ta dentro de uma cave começa a morrer, usa fly e vai parar no z= 0 ... rsrs
Eu queria que ele não pudesse ser usado se tem algum tile em cima, ou quando estiver dentro de casas, caves e etc.
Alguem pode me ajudar? rep++
Abraços.
Só mais uma coisinha, eu tambem gostaria que não desse para entrar em alguma pz usando fly...
Espero que possam me ajudar.
ninguém?