announce players hp left
Moderators: Forum moderators, developers
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.
I will be tidying it up shortly and so if you have any suggestions n3dd3h, plz post away.
GhosT:McSteve
Ghostworks Gaming Community
Ghostworks Gaming Community
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.
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.
GhosT:McSteve
Ghostworks Gaming Community
Ghostworks Gaming Community
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:
regards
any comments would be nice
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:
i checked in manual for abs like in pascal, cos the language looks similar...Can't find and instead of this i used `-´ (negation)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
regards
any comments would be nice
wolFTeam.pl
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.
GhosT:McSteve
Ghostworks Gaming Community
Ghostworks Gaming Community
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
http://lua-users.org/wiki/MathLibraryTutorial
I believe to get an absolute value you have to use math.abs(NUMER)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)
http://lua-users.org/wiki/MathLibraryTutorial