Hi, guys. I cannot figure out how to summarize all kills made with, say, he grenade or awp. I want to allow players to set money showing their kills and the problem here is not to update money, since I have all the necessary messages, but a fact that game engine processes death messages one by one and so when someone kills multiple enemies at once, the hud always shows +1 kill, though the total number of kills is correct. I want it to be cumulative, how to make it show +2, ..., +5 kills? I did some message logging, and here is what I got:
PHP Code:
[36.621555] ham_killed_pre
[36.621555] DeathMsg (83)
[36.621555] death_event
[36.621555] Health (70)
[36.621555] ham_killed_post
[36.621555] ham_killed_pre
[36.621555] DeathMsg (83)
[36.621555] death_event
[36.621555] Health (70)
[36.621555] ham_killed_post
[36.621555] ham_killed_pre
[36.621555] DeathMsg (83)
[36.621555] death_event
[36.621555] Health (70)
[36.621555] ham_killed_post
[36.621555] ham_killed_pre
[36.621555] DeathMsg (83)
[36.621555] death_event
[36.621555] Health (70)
[36.621555] ham_killed_post
* killed phillip_style with grenade
* killed -=Sh0rTy=- with grenade
* killed bussemann with grenade
* killed The Muffin Man with grenade
[36.630783] Health (70)
[36.630783] Damage (71)
client_death: 36.630783
[36.630783] Health (70)
[36.630783] Damage (71)
client_death: 36.630783
[36.634681] Health (70)
[36.661983] Health (70)
[36.661983] Damage (71)
client_death: 36.661983
[36.661983] Health (70)
[36.661983] Damage (71)
client_death: 36.661983
[36.794578] death_msg_timer
[36.794578] death_msg_timer
[36.794578] death_msg_timer
[36.794578] death_msg_timer
You can see that most vital DeathMsg messages are all at one frame with gametime: 36.621555. The problem here is that I do not know where the last kill is. So I need something that is called after all these messages and to be sure it is called all the time.
1. I wish I could rely on client_death, but this forward is not triggered on suicide (team change) or amxmodx user_slap( function.
2. I tried to use set_task_ex(0.01, "death_msg_timer") to set a timer, but for some reason it takes too much time to execute the code (173 ms)
3. Damage message appears to be triggered after all DeathMsg messages, but again it is not triggered on team change, etc...
I completely lost at this point. Is the timer single possible solution to this problem? Except client_preThink which I do not want to consider actually.
Is it possible to somehow catch these console messages?
PHP Code:
* killed phillip_style with grenade
* killed -=Sh0rTy=- with grenade
* killed bussemann with grenade
* killed The Muffin Man with grenade
They have perfect timing)
Ps: for those who have no idea what I am talking about, please see attachments (notice +1 above 4).