Ir para conteúdo
  • 0

perdendo vocação ao relogar


sk8sk8ter

Pergunta

uso esse escript aki

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local config={
removeOnUse = "yes" -- remover quando usar ("yes" or "no")
}

local days = 1 -- dias que serão adicionados
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 13540)
local timenow = os.time()

if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end

doPlayerSetVocation(cid, getPlayerVocation(cid) +4)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, 13540, time)
local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
if (config.removeOnUse == "yes") then
doRemoveItem(item.uid, 1)
end

return TRUE
end

 

 

uso essa função "" doPlayerSetVocation(cid, getPlayerVocation(cid) +4) "" pra dar as voções 9,10,11,12

da certo o cara usa o item vira vip ganha a vocação ai ele desloga e loga o char denovo e a voção epic sai e volta a ser master

 

eu acredito que falte algum escript de checagem no creaturescript ou no login.lua

 

pode me ajudar

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

intão pesquisei testei varias e varias formas e consegui resolver...

so adcionar essa função aki no seu .lua que da a vip e seu char ganhara as outras vocações claro tem que ter as voc criadas no vocações.xml com os id 9,10,11,12 e conferir se em vocações.xml la em fromvoc esta nessa seguencia 5,6,7,8

e a promote não ira sair quando o char logar ...

 

 

if doPlayerSetPromotionLevel(cid, 2) == 1 or getPlayerVocation(cid) == 5 then
doPlayerSetVocation(cid, 9)
end

if doPlayerSetPromotionLevel(cid, 2) == 2 or getPlayerVocation(cid) == 6 then
doPlayerSetVocation(cid, 10)
end


if doPlayerSetPromotionLevel(cid, 2) == 3 or getPlayerVocation(cid) == 7 then
doPlayerSetVocation(cid, 11)
end

if doPlayerSetPromotionLevel(cid, 2) == 4 or getPlayerVocation(cid) == 8 then
doPlayerSetVocation(cid, 12)
end

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...