announce players hp left

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

nedd3h
Posts: 67
Joined: Fri Jan 14, 2005 12:52 am
Location: Australia
Contact:

Post by nedd3h »

i've been keeping an eye on this thread :)
looking forward to see what comes out after testing
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post 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.

:)
GhosT:McSteve
Ghostworks Gaming Community
nedd3h
Posts: 67
Joined: Fri Jan 14, 2005 12:52 am
Location: Australia
Contact:

Post 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?
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post 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.
GhosT:McSteve
Ghostworks Gaming Community
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

yep, need3h it isnt a bug :P

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
wolFTeam.pl
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post 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.
GhosT:McSteve
Ghostworks Gaming Community
User avatar
Clutch152
Posts: 33
Joined: Thu Oct 12, 2006 8:52 pm

Post 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 :-D
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
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

ok, thx for the link

btw Clutch152 r u going to share it with us?:> Im looking forward for such thing :P

regards

p.s can i somehow replace the txt: you killed blabla ?
wolFTeam.pl
User avatar
Clutch152
Posts: 33
Joined: Thu Oct 12, 2006 8:52 pm

Post by Clutch152 »

Yes I am going to share it but it is running on my server and a friends server. If you wanna come check it out you can. My friends is still working on his server settings so I'll give you the IP to mine 70.42.41.161

I'm gonna announce it when I am done here.
:lol: :lol: :lol: :lol: :lol:
Singima
Posts: 6
Joined: Tue Aug 17, 2010 10:00 am
Location: Bosnia and Herzegovina
Contact:

Post by Singima »

how to do it like this so when u get killed a text shows like :

Killer: babyHD HP: 80
Post Reply