Page 2 of 2
Posted: Wed Jan 03, 2007 1:51 am
by nedd3h
i've been keeping an eye on this thread
looking forward to see what comes out after testing
Posted: Wed Jan 03, 2007 6:24 am
by McSteve
The script that Phenomenon posted works fine, and the one that I posted works with the admin_mod although it hasn't been tested for bugs (Luk4 spotted that negative values were being displayed sometimes, this is because your killer's health is captured at the time of the victim's death, so if your killer dies before you, negative health is shown).
I will be tidying it up shortly and so if you have any suggestions n3dd3h, plz post away.
Posted: Wed Jan 03, 2007 2:06 pm
by nedd3h
McSteve wrote:I will be tidying it up shortly and so if you have any suggestions
just one question...
Luk4ward wrote:it should be some wait command before annoucing killer's hp because its overwritten by for example: you killed blabla
does this still happen?
Posted: Wed Jan 03, 2007 2:21 pm
by McSteve
That happens fairly often with the version Phenomenon posted, because hp gets announced after every death by an enemy. With the version I posted, its a command called via admin_mod, so you dont ever see it unless you type !hp in chat/console. It is still shown as a "cp" message, but is less likely to be overwritten.
Commented out in the script I posted is the method to broadcast the message as a "qsay", which will appear in console and not be overwritten.
Posted: Wed Jan 03, 2007 2:59 pm
by Luk4ward
yep, need3h it isnt a bug
For testing new versions I just havent got to do it...Thx again and again for your help McSteve
. Are You sure the value is ok but only with minus ? If so..then:
wrote:
function et_Obituary(victimnum, killernum, meansofdeath)
local victimteam = tonumber(et.gentity_get(victimnum, "sess.sessionTeam"))
local killerteam = tonumber(et.gentity_get(killernum, "sess.sessionTeam"))
if victimteam ~= killerteam and killernum ~= 1022 then
local killername = string.gsub(et.gentity_get(killernum, "pers.netname"), "%^$", "^^ ")
local killerhp = et.gentity_get(killernum, "health")
end
if (killerhp > 0) then
et.trap_SendServerCommand(victimnum, string.format("cp "^7Your ^7killer ^7%s ^7has ^7still ^o%d ^7health ^7points ^7remaining.\n"", killername, killerhp))
else
et.trap_SendServerCommand(victimnum, string.format("cp "^7Your ^7killer ^7%s ^7has ^7still ^o%d ^7health ^7points ^7remaining.\n"", killername, -killerhp))
end
end
i checked in manual for
abs like in pascal, cos the language looks similar...Can't find and instead of this i used `-´ (negation)
regards
any comments would be nice
Posted: Sat Jan 06, 2007 1:46 am
by McSteve
Negative hp values are returned when your killer dies before you do. Changing the sign to positive changes the hp figure from slightly meaningless to just plain wrong. I could change it so if hp <0 then it says something different like "Your killer died before you did" or something.
Posted: Sat Jan 06, 2007 1:57 am
by Clutch152
Well I hope you guys don't mind but I used this in my mod which is almost finished. I changed it so if you kill some one and another player comes around the corner and kills you while you have like 10 hp it wont display anything. A friend of mine got tired of feeling like he was just owned by some one with 100 hp when he just got done killing somone and had low health. I also had it display different messages for different amounts of HP and also display a message if the killer was using adrenaline. It also displays a different message if you kill some one and then you die by their grenade, panzer, or dyno. I'll gladly credit who ever though of this
Luk4ward wrote:i checked in manual for
abs like in pascal, cos the language looks similar...Can't find and instead of this i used `-´ (negation)
I believe to get an absolute value you have to use math.abs(NUMER)
http://lua-users.org/wiki/MathLibraryTutorial
Posted: Sun Jan 07, 2007 9:57 am
by Luk4ward
ok, thx for the link
btw Clutch152 r u going to share it with us?:> Im looking forward for such thing
regards
p.s can i somehow replace the txt: you killed blabla ?
Posted: Sun Jan 07, 2007 12:34 pm
by Clutch152
Posted: Thu Sep 09, 2010 8:50 pm
by Singima
how to do it like this so when u get killed a text shows like :
Killer: babyHD HP: 80