Ir para conteúdo

Featured Replies

Postado

alguem poderia me ajudar resolver esse problema aqui? ao terminar a premium o jogador é teleportado pra thais (até ai beleza) só que, jogadores de rook guard tambem estão sendo levados para thais.... alguem pode me ajudar nisso ai?

 

function onLogin(cid)

registerCreatureEvent(cid,"FimPremium")

local pos = {x = 32369, y = 32241, z = 7}

if isPremium(cid) then

setPlayerStorageValue(cid, 59898989, 1)

elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 0 then

doCreatureChangeOutfit(cid, {lookType = 136})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)

elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 1 then
doCreatureChangeOutfit(cid, {lookType = 128})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)
end

return TRUE

end

 

Postado
function onLogin(cid)

registerCreatureEvent(cid,"FimPremium")

local pos = {x = 32369, y = 32241, z = 7}

if isPremium(cid) then

setPlayerStorageValue(cid, 59898989, 1)

elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 0 and getPlayerVocation(cid) > 0 then

doCreatureChangeOutfit(cid, {lookType = 136})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)

elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 1 and getPlayerVocation(cid) > 0 then
doCreatureChangeOutfit(cid, {lookType = 128})
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t)
t = "Your premium account is over"
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 59898989, -1)
end

return TRUE

end

Eu não testei mas o que eu fiz foi adicionar:

getPlayerVocation(cid) > 0


Ou seja, como um char de rook não tem vocação então ele não vai realizar o resto do algoritmo. Só ira prosseguir se o player tiver alguma vocação.

 

@bpm91 testa e veja se funcionou!

Editado por Rayo (veja o histórico de edições)

Contribuições:
 

=> Distribuições/Servidores

  1. [8.60] The Forgotten Server 1.3 (COMPILADO WIN x64)

 

=> Scripts/Códigos/Tutoriais

  1. Pokemon pescado aparece em volta do seu pokemon
  2. [Gesior]Dobrar pontos PagSeguro a partir de x valor doado

 

 Gostou de alguma contribuição? Rep +?

Postado
function onLogin(cid)
	local pos = {x = 32369, y = 32241, z = 7}
	if isPremium(cid) then
		setPlayerStorageValue(cid, 59898989, 1)
	elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerVocation(cid) > 0 then
		local outfit = getPlayerSex(cid) == 0 and 136 or 128 
		doCreatureChangeOutfit(cid, {lookType = outfit})
		doTeleportThing(cid, pos)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your premium account is over")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		setPlayerStorageValue(cid, 59898989, 0)
	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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo