Ir para conteúdo
  • Cadastre-se

(Resolvido)Não poder usar esse item enquanto tiver no fly


Ir para solução Resolvido por KotZletY,

Posts Recomendados

Bom galera preciso fazer com que os player não usem um determinado item enquanto estiver no fly como não sei aonde que vai colocar essa script para não usar esse item vo colocar o fly up o fly donw e a propria script desse item

MEU SCRIPT DO FLY LOGO AKI EM BAIXO FLY UP

Spoiler

function onSay(cid, words, param)

if param ~= "" then
return false
end

if getPlayerStorageValue(cid, 17000) <= 0 then
return true
end

if getThingPos(cid).z == 0 then
doPlayerSendCancel(cid, "You can\'t go higher!")
return true
end

local pos = getThingPos(cid)
pos.z = pos.z-1
pos.stackpos = 0


if getTileThingByPos(pos).itemid >= 1 or getTileItemById(getThingPos(cid), 1386).itemid >= 1 then
if getTileThingByPos(pos).itemid ~= 460 then
doPlayerSendCancel(cid, "You can\'t fly through constructions.")
return true
end
end

for x=-1,1 do
        for y=-1,1 do
            posa = {x=pos.x+x,y=pos.y+y,z=pos.z}
            if(getTileThingByPos(posa).itemid == 460) then
            if(getItemAttribute(getTileThingByPos(posa).uid, "criadopor") == getCreatureName(cid)) then
            doRemoveItem(getTileThingByPos(posa).uid, 1)
            end
            end
end
end
doCombatAreaHealth(cid, 0, pos, 0, 0, 0, CONST_ME_NONE)
itemex1 = doCreateItem(460, 1, pos)
            doItemSetAttribute(itemex1, "criadopor", getCreatureName(cid))

doTeleportThing(cid, pos)
if getCreatureOutfit(cid).lookType == 667 or getCreatureOutfit(cid).lookType == 999 then
   markPosEff(cid, getThingPos(cid))                           --edited porygon fly sistem 
end


return true
end

FLY DOWN

Spoiler

local lower = {'460', '11675', '11676'}

local houses = {'919', '1015', '1590', '1591', '1592', '1593', '1582', '1584', '1586', '1588', '5248', '5189'}

function onSay(cid, words, param)

if param ~= "" then
return false
end

if getPlayerStorageValue(cid, 17000) <= 0 then
return true
end

if getThingPos(cid).z == 7 then
doPlayerSendCancel(cid, "You can\'t go lower!")
return true
end

if getTileInfo(getThingPos(cid)).itemid == 11677 then
doPlayerSendCancel(cid, "Sorry, it's not possible to go lower.")
return true
end

if not isInArray(lower, getTileInfo(getThingPos(cid)).itemid) and getTileInfo(getThingPos(cid)).itemid >= 2 then
doPlayerSendCancel(cid, "You can\'t go lower.")
return true
end

local pos = getThingPos(cid)
pos.z = pos.z+1
pos.stackpos = 0

if getTileThingByPos(pos).itemid >= 1 then

if getTilePzInfo(pos) == true then
doPlayerSendCancel(cid, "You can\'t go down here.")
return true
end

if not canWalkOnPos(pos, true, true, false, false, true) then
doPlayerSendCancel(cid, "You can't go down here.")
return true
end

doTeleportThing(cid, pos)
if getCreatureOutfit(cid).lookType == 667 or getCreatureOutfit(cid).lookType == 999 then
   markPosEff(cid, getThingPos(cid))
end

else

for x=-1,1 do
        for y=-1,1 do
            posa = {x=pos.x+x,y=pos.y+y,z=pos.z}
            if isInArray(lower, getTileThingByPos(posa).itemid) then
            if(getTileThingByPos(posa).itemid == 460) then
            if(getItemAttribute(getTileThingByPos(posa).uid, "criadopor") == getCreatureName(cid)) then
            doRemoveItem(getTileThingByPos(posa).uid, 1)
            end
            end
            end
end
end
            
doCombatAreaHealth(cid, 0, pos, 0, 0, 0, CONST_ME_NONE)
itemex1 = doCreateItem(460, 1, pos)
            doItemSetAttribute(itemex1, "criadopor", getCreatureName(cid))

doTeleportThing(cid, pos)
if getCreatureOutfit(cid).lookType == 667 or getCreatureOutfit(cid).lookType == 999 then
   markPosEff(cid, getThingPos(cid))                                  --edited porygon fly sistem
end

return true
end
return true
end

script do item ID DO ITEM E >>>   13629

Spoiler

local looktype = 3025 -- looktype da outfit.
  
function onUse(cid, item, frompos, item2, topos)
    if getCreatureOutfit (cid).lookType ~= looktype then
        doSetCreatureOutfit (cid, {lookType = looktype}, -1)
    else
        doPlayerSendTextMessage (cid, 19, "Você já está utilizando esta roupa!")
    end
return true
end

 

FLY Q ESTA NO MOVIMENTES

Spoiler

local del = {'460', '1022', '1023', '11675', '11676', '11677'}
local updown = {'1', '3'}

function onStepIn(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 17000) <= 0 then
doTeleportThing(cid, topos, false)
if(getItemAttribute(getTileThingByPos(posa).uid, "criadopor") == getCreatureName(cid)) then
doRemoveItem(getTileThingByPos(frompos).uid, 1)
end
if isPlayer(cid) then
doPlayerSendCancel(cid, "You can't fly.")
end
return true
end
if getPlayerStorageValue(cid, 17000) >= 1 then
if topos.z == frompos.z then
if getCreatureOutfit(cid).lookType == 316 then
effect = 136
else
effect = 2
end
doSendMagicEffect(topos, effect)
end
end
for x=-1,1 do
        for y=-1,1 do
            posa = {x=topos.x+x,y=topos.y+y,z=topos.z}
            if isInArray(del, getTileThingByPos(posa).itemid) then
            if(getTileThingByPos(posa).itemid == 460) then
            if(getItemAttribute(getTileThingByPos(posa).uid, "criadopor") == getCreatureName(cid)) then
            doRemoveItem(getTileThingByPos(posa).uid, 1)
            end
            else
            doRemoveItem(getTileThingByPos(posa).uid, 1)
            end
            end
end
end
for x=-1,1 do
        for y=-1,1 do
            pose = {x=frompos.x+x,y=frompos.y+y,z=frompos.z}
            if getTileThingByPos(pose).itemid == 0 then
            doCombatAreaHealth(cid, 0, pose, 0, 0, 0, CONST_ME_NONE)
            itemex = doCreateItem(460, 1, pose)
            doItemSetAttribute(itemex, "criadopor", getCreatureName(cid))
end
end
end
doCombatAreaHealth(cid, 0, topos, 0, 0, 0, CONST_ME_NONE)
if getTileThingByPos(frompos).itemid == 0 then
itemex1 = doCreateItem(460, 1, frompos)
            doItemSetAttribute(itemex1, "criadopor", getCreatureName(cid))
end
return true
end    

 

tipo quando o player for usar esse item aparecer uma msg Voce não pode usar esse item enquanto estiver no fly algo do tipo tem como ajudar.. 

Editado por iury alves potter (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

@iury alves potter 

Spoiler

local looktype = 3025 -- looktype da outfit.
  
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 17000) < 1 then
    if getCreatureOutfit (cid).lookType ~= looktype then
        doSetCreatureOutfit (cid, {lookType = looktype}, -1)
    else
        doPlayerSendTextMessage (cid, 19, "Você já está utilizando esta roupa!")
    end
else
	doPlayerSendTextMessage (cid, 19, "Você não pode usar esse outfit em quanto estiver no fly.")
end
	return true
end

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo