Ir para conteúdo

Featured Replies

Postado

Boa tarde, alguém poderia me dizer se é possível colocar para certas vocações não poderem usar o scroll abaixo, pois alguns jogadores colocam ele na porta das houses fazendo jogadores com vocações vip perderem suas vocações vip ao clicar na porta da house, então para solucionar eu queria colocar os id's das vocações que não poderiam usar esse scroll:

function onUse(cid, item, frompos, item2, topos)

if getVocationInfo(getPlayerVocation(cid)).name == "Pain" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um pain!")
else
doPlayerSetVocation(cid, 280)
doCreatureSay(cid, "Pain Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 499)
doCreatureChangeOutfit(cid, {lookType = 503})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+80000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+80000)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
return TRUE
end

Os id's das vocações que não podem usar são esses: 413, 414, 415, 416, 417, 418

 

Editado por One Punch Man (veja o histórico de edições)

x1fCxnI.png

Postado

Testa ai:

local lockVoc = {413, 414, 415, 416, 417, 418}

function onUse(cid, item, frompos, item2, topos)
    if isInArray(lockVoc, getPlayerVocation(cid))
        return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Sua vocação não pode usar esse item.')
    end

    if getVocationInfo(getPlayerVocation(cid)).name == "Pain" then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um pain!")
    else
        doPlayerSetVocation(cid, 280)
        doCreatureSay(cid, "Pain Owns!!", 19) 
        doSendMagicEffect(getCreaturePosition(cid), 499)
        doCreatureChangeOutfit(cid, {lookType = 503})
    if getPlayerStorageValue(cid, 5) < 1 then
        setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+80000)
        setCreatureMaxMana(cid, getCreatureMaxMana(cid)+80000)
        setPlayerStorageValue(cid, 5, 1)
    end
       setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
       doRemoveItem(item.uid)
    end
   return TRUE
end

 

Editado por Wakon (veja o histórico de edições)

Postado

Ainda estou aprendendo bem no começo, mas tenta:

 

Spoiler

function onUse(cid, item, frompos, item2, topos)

if getVocationInfo(id, 413, 414, 415, 416, 417, 418) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja e uma vocacao")
else
doPlayerSetVocation(cid, 280)
doCreatureSay(cid, "Pain Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 499)
doCreatureChangeOutfit(cid, {lookType = 503})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+80000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+80000)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
return TRUE
end

 

 

Se não funcionar tente: 

 

Spoiler

function onUse(cid, item, frompos, item2, topos)

if getVocationInfo(413, 414, 415, 416, 417, 418) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja e uma vocacao")
else
doPlayerSetVocation(cid, 280)
doCreatureSay(cid, "Pain Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 499)
doCreatureChangeOutfit(cid, {lookType = 503})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+80000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+80000)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
return TRUE
end

 

 

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo