Ir para conteúdo
  • Cadastre-se

(Resolvido)Colocar Level Para Usar Essa Scroll


Ir para solução Resolvido por esnio12,

Posts Recomendados

Olá TK, bom.. queria que alguém pudesse me ajudar nessa script, pois meu conhecimento e limitado nessa área.

 Somente para poder ao usar a Scroll se tiver level 1, Ou seja se tiver level maior não usar.

 

Script :

Citar

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

if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!")
else
doPlayerSetVocation(cid, 210)
doCreatureSay(cid, "Madara Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 224)
doCreatureChangeOutfit(cid, {lookType = 368})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 16200, 1)
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
return TRUE
end

+ Rep obrigado a todos !

Link para o post
Compartilhar em outros sites
  • Moderador

Tenta assim:

 

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

if getPlayerLevel(cid) == 0 then
if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!")
else
doPlayerSetVocation(cid, 210)
doCreatureSay(cid, "Madara Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 224)
doCreatureChangeOutfit(cid, {lookType = 368})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 16200, 1)
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
end
return TRUE
end

 

Link para o post
Compartilhar em outros sites
2 horas atrás, movie disse:

Tenta assim:

 


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

if getPlayerLevel(cid) == 0 then
if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!")
else
doPlayerSetVocation(cid, 210)
doCreatureSay(cid, "Madara Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 224)
doCreatureChangeOutfit(cid, {lookType = 368})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 16200, 1)
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
end
return TRUE
end

 

 

funfo não, nem da pra usar o item.

Link para o post
Compartilhar em outros sites
  • Moderador
5 minutos atrás, leozincorsair disse:

funfo não, nem da pra usar o item.

 

Apareceu erro na distro?

 

 Tenta assim:

 

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

if getPlayerLevel(cid) = 0 then
if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!")
else
doPlayerSetVocation(cid, 210)
doCreatureSay(cid, "Madara Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 224)
doCreatureChangeOutfit(cid, {lookType = 368})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 16200, 1)
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
end
return TRUE
end

 

Link para o post
Compartilhar em outros sites
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= 1 then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHLEVEL)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!")
else
doPlayerSetVocation(cid, 210)
doCreatureSay(cid, "Madara Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 224)
doCreatureChangeOutfit(cid, {lookType = 368})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 16200, 1)
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
return TRUE
end

 

Link para o post
Compartilhar em outros sites
2 horas atrás, Celulose disse:

function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= 1 then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHLEVEL)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!")
else
doPlayerSetVocation(cid, 210)
doCreatureSay(cid, "Madara Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 224)
doCreatureChangeOutfit(cid, {lookType = 368})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 16200, 1)
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
return TRUE
end

 

 

Testei e nao funcionou, coloquei em char lv 1 e ainda diz que esta no level errado

msg : "you do not have enough level"

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

Olá,  boa noite, tente assim.

 

function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) == 1 then
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHLEVEL)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
else
doPlayerSetVocation(cid, 210)
doCreatureSay(cid, "Madara Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 224)
doCreatureChangeOutfit(cid, {lookType = 368})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 16200, 1)
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
return true
end

 

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

Olá,  boa noite, tente assim.

 


function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) == 1 then
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHLEVEL)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
else
doPlayerSetVocation(cid, 210)
doCreatureSay(cid, "Madara Owns!!", 19) 
doSendMagicEffect(getCreaturePosition(cid), 224)
doCreatureChangeOutfit(cid, {lookType = 368})
if getPlayerStorageValue(cid, 5) < 1 then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+100)
setPlayerStorageValue(cid, 5, 1)
end
setPlayerStorageValue(cid, 16200, 1)
setPlayerStorageValue(cid, 300, (getPlayerVocation(cid)))
doRemoveItem(item.uid)
end
return true
end

 

 

Obrigado men !! funcionou certinho

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