Ir para conteúdo
Banner com Efeitos

Featured Replies

  • Respostas 14
  • Visualizações 934
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • bom, vo posta um script aqui que é parecido com o que vc quer, mas ele faz um broadcast do cara que matou outro player, e ele acaba recebendo um premio por isso, com alguns efeitos de animação ok? se

Postado

bom, vo posta um script aqui que é parecido com o que vc quer, mas ele faz um broadcast do cara que matou outro player, e ele acaba recebendo um premio por isso, com alguns efeitos de animação ok? se nao curtir nao usa e a gente tenta cata outro!

1o inclua no creaturescripts.xml:


<event type="death" name="DeathBroadcast" script="deathBroadcast.lua"/>

2o no login.lua (la dentro da pasta /creaturescripts/scripts/) inclua:

registerCreatureEvent(cid, "DeathBroadcast")

3o. crie o arquivo deathbroadcast.lua nba pasta /creaturescripts/scripts/ e cole:

local config = {

	    killStorageValue = 3943,

	    deathStorageValue = 3944,


	    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME

	    rewardItem = {

			    use = true,

			    itemid = 8698,

			    minLevel = 100, -- false se nao quiser requerimento de level

			    text = "Este é um presente para |KILLERNAME| [|KILLERLEVEL|] por matar |TARGETNAME| [|TARGETLEVEL|]"

	    },


	    killMessage = {

			    use = true,

			    text = "Você arrebentou |TARGETNAME|! E tem agora |KILLERKILLS| mortes!",

			    messageClass = MESSAGE_STATUS_CONSOLE_BLUE

	    },


	    broadcastMessage = {

			    use = true,

			    text = "|KILLERNAME| [|KILLERLEVEL|] acabou de matar |TARGETNAME| [|TARGETLEVEL|]!",

			    messageClass = MESSAGE_STATUS_WARNING

	    },


	    killerAnimation = {

			    use = true,

			    text = "Frag!", -- Only 9 letters! No "commands" here.

			    color = 215

	    },


	    targetAnimation = {

			    use = true,

			    text = "Tooooma!", -- maximo de 9 letras, sem comandos.

			    color = 215

	    }

}


function onDeath(cid, corpse, killer)

	    if(isPlayer(killer) == TRUE) then

			    local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1

			    local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1


			    local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1

			    local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1


			    setPlayerStorageValue(killer, config.killStorageValue, targetKills)

			    setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)


			    local values = {

					    ["KILLERKILLS"]		 = killerKills,

					    ["KILLERDEATHS"]	    = killerDeaths,

					    ["KILLERNAME"]		  = getCreatureName(killer),

					    ["KILLERLEVEL"]		 = getPlayerLevel(killer),


					    ["TARGETKILLS"]		 = targetKills,

					    ["TARGETDEATHS"]	    = targetDeaths,

					    ["TARGETNAME"]		  = getCreatureName(cid),

					    ["TARGETLEVEL"]		 = getPlayerLevel(cid)

			    }


			    function formateString(str)

					    return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))

			    end


			    if(config.rewardItem.use and (not config.rewardItem.level or getPlayerLevel(cid) >= config.rewardItem.level)) then

					    local uid = doPlayerAddItem(killer, config.rewardItem.itemid)

					    doSetItemSpecialDescription(uid, formateString(config.rewardItem.text))

			    end

			    if(config.killMessage.use) then

					    doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))

			    end

			    if(config.broadcastMessage.use) then

					    broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)

			    end

			    if(config.killerAnimation.use) then

					    doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)

			    end

			    if(config.targetAnimation.use) then

					    doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)

			    end

	    end


	    return TRUE

end

Creditos: colandus

Postado

hsuahsua e funciona de boa, eh maneiro? Mas explica ai, tu quer q quem veja a mensagem, o morto ou o matador?

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