Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

 

Qual o motivo deste tópico? 

 

Está surgindo algum erro? Se sim coloque-o aqui. 

  Citar

Galera, queria criar uma quest de vocaçao, pra quando a pessoa termina quest, pega promotion pra proxima, na vocation.xml ja ta feito problema e o bau.

usei esse debaixo mais nao pega, @WooX

 

Você tem o código disponível? Se tiver publique-o aqui: 

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

voc = getPlayerVocation(cid)
queststatus = getPlayerStorageValue(cid,90909)

elseif getPlayerStorageValue(cid, 35100) >= 1 then
if voc == 5 then
if queststatus == -1 then
setPlayerPromotionLevel(cid, 3)
setPlayerStorageValue(cid,90909,1)
doSendMagicEffect(getCreaturePos(cid), 66)
doPlayerSendTextMessage(cid,19,"Parabens Voce pegou sua Promotion.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ja pegou esta promotion  (Aprendiz 1+Resets), Ou nao tem level suficiente.")
end
elseif getPlayerStorageValue(cid, 35100) >= 1 then
if voc == 6 then
if queststatus == -1 then
setPlayerPromotionLevel(cid, 3)
setPlayerStorageValue(cid,90909,1)
doSendMagicEffect(getCreaturePos(cid), 66)
doPlayerSendTextMessage(cid,19,"Parabens Voce pegou sua Promotion.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ja pegou esta promotion (Aprendiz 1+Resets), Ou nao tem level suficiente.")
end
elseif getPlayerStorageValue(cid, 35100) >= 1 then
if voc == 7 then
if queststatus == -1 then
setPlayerPromotionLevel(cid, 3)
setPlayerStorageValue(cid,90909,1)
doSendMagicEffect(getCreaturePos(cid), 66)
doPlayerSendTextMessage(cid,19,"Parabens Voce pegou sua Promotion.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ja pegou esta promotion (Aprendiz 1+Resets), Ou nao tem level suficiente.")
end
elseif getPlayerStorageValue(cid, 35100) >= 1 then
if voc == 8 then
if queststatus == -1 then
setPlayerPromotionLevel(cid, 3)
setPlayerStorageValue(cid,90909,1)
doSendMagicEffect(getCreaturePos(cid), 66)
doPlayerSendTextMessage(cid,19,"Parabens Voce pegou sua Promotion.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ja pegou esta promotion (Aprendiz 1+Resets), Ou nao tem level suficiente.")
end
end
end
end

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Postado

@ADM Mezenga Veja se é algo assim que você quer:

 

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

local config = {
	storageAlready = 90909,
	storageRequired = 35100,
	effect = 66,

	msg = {
		success = "Parabens voce pegou sua Promotion.",
		invalid = "Voce ja pegou esta promotion (Aprendiz 1+Resets), Ou nao tem level suficiente.",
	}
}

if getPlayerStorageValue(cid, config.storageRequired) >= 1 then
	if getPlayerVocation(cid) == 5 then
		if getPlayerStorageValue(cid, config.storageAlready) == -1 then
			setPlayerPromotionLevel(cid, 1)
			setPlayerStorageValue(cid, config.storageAlready, 1)
			doSendMagicEffect(getCreaturePos(cid), config.effect)
			doPlayerSendTextMessage(cid, 19, config.msg.success)
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msg.invalid)
		end
	end
end
return true
end

 

Postado

Tente isso

local storage = 34550

function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid, storage) ~= -1 then
		return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'This is empty.')
	end
	
	if getPlayerVocation(cid) > 5 then
		return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You is already promoted.')
	end
	
	setPlayerPromotionLevel(cid, 1)
	setPlayerStorageValue(cid, storage, 1)
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
	doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Congratulations, you are promoted.')
	return true
end

 

Postado
  • Autor

tipo essas ai ele vai pra de paladin pra royal paladin por exemplo, como faço pra por pra novas promotions, essa e minha xml

Mostrar conteúdo oculto

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo