Postado Fevereiro 26, 2017 8 anos Como o titulo diz eh simples mais eu queria que o player so pudesse trocar de vocation naquele character ate certo level tipo : "voce nao pode mais trocar de character , somente player com level menor que 50." enfim queria que o player só conseguisse usar esse item se ele fosse level baixo , mais se ele fosse level 51 em diante nao pudesse mais. ( Eh Possivel ? ) --- SCRIPT ---- function onUse(cid, item, frompos, item2, topos) if getVocationInfo(getPlayerVocation(cid)).name == "Hashirama" then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Ja é um Hashirama!") else doPlayerSetVocation(cid, 1) doCreatureSay(cid, "Hashirama Owns!!", 19) doSendMagicEffect(getCreaturePosition(cid), 1) doCreatureChangeOutfit(cid, {lookType = 1}) if getPlayerStorageValue(cid, 5) < 1 then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+80000) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+80000) setPlayerStorageValue(cid, 5, 1) end setPlayerStorageValue(cid, 16200, 1) setPlayerStorageValue(cid, 300, (getPlayerVocation(cid))) doRemoveItem(item.uid) end return TRUE end
Postado Fevereiro 26, 2017 8 anos function onUse(cid, item, frompos, item2, topos) if getVocationInfo(getPlayerVocation(cid)).name == "Hashirama" then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Ja é um Hashirama!") elseif getPlayerLevel > 50 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao pode trocar de character, apenas player level inferior a 50") else doPlayerSetVocation(cid, 1) doCreatureSay(cid, "Hashirama Owns!!", 19) doSendMagicEffect(getCreaturePosition(cid), 1) doCreatureChangeOutfit(cid, {lookType = 1}) if getPlayerStorageValue(cid, 5) < 1 then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+80000) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+80000) setPlayerStorageValue(cid, 5, 1) end setPlayerStorageValue(cid, 16200, 1) setPlayerStorageValue(cid, 300, (getPlayerVocation(cid))) doRemoveItem(item.uid) end return TRUE end Editado Fevereiro 26, 2017 8 anos por Weslley Kiyo (veja o histórico de edições)
Postado Fevereiro 26, 2017 8 anos 20 horas atrás, Weslley Kiyo disse: function onUse(cid, item, frompos, item2, topos) if getVocationInfo(getPlayerVocation(cid)).name == "Hashirama" then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Ja é um Hashirama!") elseif getPlayerLevel > 50 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao pode trocar de character, apenas player level inferior a 50") else doPlayerSetVocation(cid, 1) doCreatureSay(cid, "Hashirama Owns!!", 19) doSendMagicEffect(getCreaturePosition(cid), 1) doCreatureChangeOutfit(cid, {lookType = 1}) if getPlayerStorageValue(cid, 5) < 1 then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+80000) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+80000) setPlayerStorageValue(cid, 5, 1) end setPlayerStorageValue(cid, 16200, 1) setPlayerStorageValue(cid, 300, (getPlayerVocation(cid))) doRemoveItem(item.uid) end return TRUE end Tem só um erro, pega ai function onUse(cid, item, frompos, item2, topos) if getVocationInfo(getPlayerVocation(cid)).name == "Hashirama" then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Ja é um Hashirama!") elseif getPlayerLevel(cid) > 50 then -- tava faltando o (cid) aqui doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao pode trocar de character, apenas player level inferior a 50") else doPlayerSetVocation(cid, 1) doCreatureSay(cid, "Hashirama Owns!!", 19) doSendMagicEffect(getCreaturePosition(cid), 1) doCreatureChangeOutfit(cid, {lookType = 1}) if getPlayerStorageValue(cid, 5) < 1 then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+80000) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+80000) setPlayerStorageValue(cid, 5, 1) end setPlayerStorageValue(cid, 16200, 1) setPlayerStorageValue(cid, 300, (getPlayerVocation(cid))) doRemoveItem(item.uid) end return TRUE end GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
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.