Ir para conteúdo

Featured Replies

Postado

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
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 por Weslley Kiyo (veja o histórico de edições)

Postado
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

 

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