Ir para conteúdo

Featured Replies

Postado

Um alerta ao player quando morrer, dizendo que ele esta sem bless. Só exibe uma vez depois que loga de uma morte (mais sempre que morre né, dã)

 

[WARNING]
You are not fully blessed! 
If you die, you might lose equipment.

 

 

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

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Resolvido por Dwarfer

Ir para solução
  • Respostas 10
  • Visualizações 667
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Em creaturescripts/scripts, crie um arquivo:   blessmsg.lua     No login.lua: registerCreatureEvent(cid, "BlessMsg")   No creaturescripts.xml:   <event typ

  • @DiigooMix   Registrou o evento no login.lua? Coloca aí certinho que vai funcionar.   @Enzo Caue Pior que não, amigo. Funciona pra tfs 0.4 também.  

  • Abaixo de: registerCreatureEvent(cid, "RemovedorDeFrags")   adicione:   registerCreatureEvent(cid, "BlessMsg")  

Postado

local freeBlessMaxLevel = 150
 
function onLogin(cid)
    if not isPlayer(cid) then return true end
    if(getPlayerLevel(cid) <= freeBlessMaxLevel and not getPlayerBlessing(cid,1)) then
        for b=1, 5 do
            doPlayerAddBlessing(cid, b)
        end
        doCreatureSay(cid, 'Voce tem bless gratuita, porque seu level é menor que 150', TALKTYPE_ORANGE_1)
        doSendMagicEffect(getThingPosition(cid), CONST_ME_HOLYDAMAGE)
        elseif(getPlayerBlessing(cid,1)) then
    doCreatureSay(cid, 'Você já tem bless!', TALKTYPE_ORANGE_1)
    else
    doCreatureSay(cid, 'Você não tem bless. Digite !bless cuidado pode dar exausted', TALKTYPE_ORANGE_1)
    end
    return true
end

Postado
  • Autor
1 hora atrás, Antipush disse:

local freeBlessMaxLevel = 150
 
function onLogin(cid)
    if not isPlayer(cid) then return true end
    if(getPlayerLevel(cid) <= freeBlessMaxLevel and not getPlayerBlessing(cid,1)) then
        for b=1, 5 do
            doPlayerAddBlessing(cid, b)
        end
        doCreatureSay(cid, 'Voce tem bless gratuita, porque seu level é menor que 150', TALKTYPE_ORANGE_1)
        doSendMagicEffect(getThingPosition(cid), CONST_ME_HOLYDAMAGE)
        elseif(getPlayerBlessing(cid,1)) then
    doCreatureSay(cid, 'Você já tem bless!', TALKTYPE_ORANGE_1)
    else
    doCreatureSay(cid, 'Você não tem bless. Digite !bless cuidado pode dar exausted', TALKTYPE_ORANGE_1)
    end
    return true
end

 

Não é isso, quero apenas que dê o alerta ao morrer e perder a bless.

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Postado
  • Solução

Em creaturescripts/scripts, crie um arquivo:

 

blessmsg.lua

 

Spoiler

function onDeath(cid, corpse, deathList)
if not isPlayer(cid) then return true end
setPlayerStorageValue(cid, 23771, 1)
return true
end

function onLogin(cid)
    if getPlayerStorageValue(cid, 23771) == 1 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[WARNING] You are not fully blessed! If you die, you might lose equipament.")
        setPlayerStorageValue(cid, 23771, -1)
    end
    return true
end

 

 

No login.lua: registerCreatureEvent(cid, "BlessMsg")

 

No creaturescripts.xml: 

 <event type="login" name="msgbless" event="script" value="blessmsg.lua"/>
 <event type="death" name="BlessMsg" event="script" value="blessmsg.lua"/>

Contato:

 

Postado
  • Autor
3 horas atrás, Dwarfer disse:

Em creaturescripts/scripts, crie um arquivo:

 

blessmsg.lua

 

  Ocultar conteúdo


function onDeath(cid, corpse, deathList)
if not isPlayer(cid) then return true end
setPlayerStorageValue(cid, 23771, 1)
return true
end

function onLogin(cid)
    if getPlayerStorageValue(cid, 23771) == 1 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[WARNING] You are not fully blessed! If you die, you might lose equipament.")
        setPlayerStorageValue(cid, 23771, -1)
    end
    return true
end

 

 

No login.lua: registerCreatureEvent(cid, "BlessMsg")

 

No creaturescripts.xml: 

 <event type="login" name="msgbless" event="script" value="blessmsg.lua"/>
 <event type="death" name="BlessMsg" event="script" value="blessmsg.lua"/>

 

Valeu, é isso mesmo!

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

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.6k

Informação Importante

Confirmação de Termo