Postado Dezembro 9, 2015 9 anos 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 Dezembro 9, 2015 9 anos por One Punch Man (veja o histórico de edições)
Postado Dezembro 9, 2015 9 anos 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 Dezembro 9, 2015 9 anos por Wakon (veja o histórico de edições) ➥ Regras | Seções OTServ | Seções BOT
Postado Dezembro 9, 2015 9 anos 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.