Ir para conteúdo
  • Cadastre-se

(Resolvido)[Ajudem]


Ir para solução Resolvido por antharaz,

Posts Recomendados

Bom pessoal é o seguinte, estou com script de pet no meu servidor. Fiz uma nova vocação (summoner) que vai usar como base o pet system, porem para invocar o pet, é necessario clicar no "Pet Doll".

Porem todo mundo que clicar no "pet doll" acaba invocando o pet, eu não quero isso, quero que apenas a vocação nova possa invocar o pet, alguem pode me ajudar?

 

Meu script:

Spoiler

function onUse(cid, item, frompos, item2, topos)
      if getTilePzInfo(getCreaturePosition(cid)) then       
         doPlayerSendCancel(cid,"Esse monstro nao pode ser sumonado em protect zone!.")       
         return TRUE       
      end       
 
 
if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, 6,"Por medidas de segurança você só pode utilizar este comando em " .. 
(getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return true
end 
storage = 11548
if #getCreatureSummons(cid) >= 1 then
  return doPlayerSendCancel(cid,"Voce nao pode ter summons para batalhar!")
        end
 
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
return true
end
 
 
local summons = getCreatureSummons(cid)
 
 
local pet = {
["Old Dragon"] = {1,54},
["Malagueta"] = {55,59},
["Frozen Dragon"] = {60,64},
["Pharma"] = {65,70},
["infernatil"] = {150,10},

}
 
 
for k,v in pairs(pet) do -- 1
 
 
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,11548,os.time()+5)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
 
 
end
return true
end

 

Link para o post
Compartilhar em outros sites
  • Solução

Pronto.

Spoiler

local vocs_id = {7,9}

function onUse(cid, item, frompos, item2, topos)
      if not isInArray(vocs_id,getPlayerVocation(cid)) then       
         doPlayerSendCancel(cid,"Sua vocação não pode summonar um pet.")   
         soSendMagicEffect(getThingPos(cid),2)      
         return false       
      end    

       if getTilePzInfo(getCreaturePosition(cid)) then       
         doPlayerSendCancel(cid,"Esse monstro nao pode ser sumonado em protect zone!.")       
         return TRUE       
      end    
 
if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, 6,"Por medidas de segurança você só pode utilizar este comando em " .. 
(getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return true
end 
storage = 11548
if #getCreatureSummons(cid) >= 1 then
  return doPlayerSendCancel(cid,"Voce nao pode ter summons para batalhar!")
        end
 
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
return true
end
 
 
local summons = getCreatureSummons(cid)
 
 
local pet = {
["Old Dragon"] = {1,54},
["Malagueta"] = {55,59},
["Frozen Dragon"] = {60,64},
["Pharma"] = {65,70},
["infernatil"] = {150,10},
}
 
 
for k,v in pairs(pet) do -- 1
 
 
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,11548,os.time()+5)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
 
 
end
return true
end

 

 

 

Em vocs_id vc deixa as vocações que poderão usar a doll, no caso deixei 7 e 9, mas se for só uma é só deixar 1 lá, ex: local vocs_id = {7}

Editado por antharaz (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
21 minutos atrás, antharaz disse:

Pronto.

  Ocultar conteúdo


local vocs_id = {7,9}

function onUse(cid, item, frompos, item2, topos)
      if not isInArray(vocs_id,getPlayerVocation(cid)) then       
         doPlayerSendCancel(cid,"Sua vocação não pode summonar um pet.")   
         soSendMagicEffect(getThingPos(cid),2)      
         return false       
      end    

       if getTilePzInfo(getCreaturePosition(cid)) then       
         doPlayerSendCancel(cid,"Esse monstro nao pode ser sumonado em protect zone!.")       
         return TRUE       
      end    
 
if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, 6,"Por medidas de segurança você só pode utilizar este comando em " .. 
(getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return true
end 
storage = 11548
if #getCreatureSummons(cid) >= 1 then
  return doPlayerSendCancel(cid,"Voce nao pode ter summons para batalhar!")
        end
 
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
return true
end
 
 
local summons = getCreatureSummons(cid)
 
 
local pet = {
["Old Dragon"] = {1,54},
["Malagueta"] = {55,59},
["Frozen Dragon"] = {60,64},
["Pharma"] = {65,70},
["infernatil"] = {150,10},
}
 
 
for k,v in pairs(pet) do -- 1
 
 
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,11548,os.time()+5)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
 
 
end
return true
end

 

 

 

Em vocs_id vc deixa as vocações que poderão usar a doll, no caso deixei 7 e 9, mas se for só uma é só deixar 1 lá, ex: local vocs_id = {7}

 

@antharaz tu tem facebook mano?

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