[duvida] Sistema De Morte

praquenomegrandelol

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/05/09Posts: 20Char no Tibia: Lemol Babol

eu tenho um sistema de morte , ta ae a parte que fala sobre o que eu quero :

doBroadcastMessage(""..hitKillerName.." Matou "..getPlayerName(cid)..".")

 

e quando a pessoa morre apareçe assim:

 

"Player2 Matou Player1"

 

Ou

 

"Monstro Matou Player1"

 

mas a mensagem vai em vermelho na tela , gostaria que fosse em laranja..

 

Obrigado

~~Lugar Reservado Para Minha Assinatura!~~

Enquanto Isso Na Escola



QUOTE
Vinicius [Prof° Geo] : Daqui um tempo o ser humano não vai aguenta de tanto calor.
Victor [Aluno] : Qual a temperatura maxima que o Ser Humano Pode Aguenta?
Vinicius [Prof° Geo] : Ah , sei la , uns 40~~45° Graus.
Gustavo [Aluno] : 40 graus é o chuveiro la de casa ¬¬'


LOL?

joaohd

Neox Boy
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/02/09Posts: 361Char no Tibia: Fearless Man

eu acho que isso é o que você quer

local config = {

deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),

sqlType = getConfigInfo('sqlType'),

maxDeathRecords = getConfigInfo('maxDeathRecords')

}

 

config.sqlType = config.sqlType == " mysql" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

 

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)

if(config.deathListEnabled ~= TRUE) then

return

end

 

local hitKillerName = "field item"

local damageKillerName = ""

if(lastHitKiller ~= FALSE) then

if(isPlayer(lastHitKiller) == TRUE) then

hitKillerName = getCreatureName(lastHitKiller)

else

hitKillerName = getCreatureName(lastHitKiller)

end

 

doBroadcastMessage(cid, ""..hitKillerName.." Matou "..getPlayerName(cid)..".", TALKTYPE_ORANGE_1)

 

if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then

if(isPlayer(mostDamageKiller) == TRUE) then

damageKillerName = getPlayerGUID(mostDamageKiller)

else

damageKillerName = getCreatureName(mostDamageKiller)

end

end

end

 

db.executeQuery(" INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")

local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")

if(rows:getID() ~= -1) then

local amount = rows:getRows(true) - config.maxDeathRecords

if(amount > 0) then

if(config.sqlType == DATABASE_ENGINE_SQLITE) then

for i = 1, amount do

db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")

end

else

db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")

end

end

end

end

 

eu acho que vai funcionar. não testei. mas era só inverter a sequencia.

 

flws

praquenomegrandelol

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/05/09Posts: 20Char no Tibia: Lemol Babol

opa apocarai*, funcionando certinho

 

"Ghazbaran Matou Test"

 

essa parte eu ja tinha arrumado depois que eu vi ....

 

mais a mensagem em laranja eu não sabia , brigadão !

~~Lugar Reservado Para Minha Assinatura!~~

Enquanto Isso Na Escola



QUOTE
Vinicius [Prof° Geo] : Daqui um tempo o ser humano não vai aguenta de tanto calor.
Victor [Aluno] : Qual a temperatura maxima que o Ser Humano Pode Aguenta?
Vinicius [Prof° Geo] : Ah , sei la , uns 40~~45° Graus.
Gustavo [Aluno] : 40 graus é o chuveiro la de casa ¬¬'


LOL?

Matt-

Ex-Moderador Xtibia
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 02/02/09Posts: 302

Dúvida Esclarecida, por tanto (Tópico Fechado)



Matt

Ex-Moderador