In player_death Check for weapon_healthshot ?
I am writing a pluginfor CSGO that when a player dies if they have a weapon_healthshot a center text message will print.
This works but I only want to see this message if I was the person that killed them and made them drop the healthshot. Edit: After a LOT of messing around, Got it working! PHP Code:
|
Re: In player_death Check for weapon_healthshot ?
Which game?
You can store the client's killer (get from "player_death" event, "attacker" parameter) in some client array e.g: PHP Code:
PHP Code:
Btw if you won't do anything on WeaponDrop (I mean, change the behaviour) I recommend using WeaponDropPost. |
Re: In player_death Check for weapon_healthshot ?
Got it.
Thanks. |
Re: In player_death Check for weapon_healthshot ?
After a LOT of messing around, Got it working.
Looks like the player drops his items BEFORE the player_death event is fired and I even saw sometimes player_death was intermixed with the items being dropped. And when you use a shot it generates an item drop for it. This isn't perfect since if a player drops a heathshot while still alive it will still be reported when they die but it's a bot server and they never use or drop shots unless it is on death. I updated the original post with the working code. thanks |
Re: In player_death Check for weapon_healthshot ?
one example with SDKHook
PHP Code:
|
Re: In player_death Check for weapon_healthshot ?
Bacardi, thanks for this.
It is it cleaner and less of a hack then my original solution. Your plugin compiles and runs but it lists the weapons twice for each kill. Why is that and it makes the solution unusable. From some testing. bot 1 killed Victim weapon weapon_knife Victim weapon weapon_fiveseven Victim weapon weapon_mac10 Victim weapon weapon_knife Victim weapon weapon_fiveseven Victim weapon weapon_mac10 bot 2 killed Victim weapon weapon_knife Victim weapon weapon_fiveseven Victim weapon weapon_knife Victim weapon weapon_fiveseven bot 3 killed Victim weapon weapon_knife Victim weapon weapon_fiveseven Victim weapon weapon_ak47 Victim weapon weapon_c4 Victim weapon weapon_knife Victim weapon weapon_fiveseven Victim weapon weapon_ak47 Victim weapon weapon_c4 |
Re: In player_death Check for weapon_healthshot ?
ok, I think because I used SDKHook_OnTakeDamageAlivePost.
I did not notice, player health was already decreased when this event happen. And when player health go low, it printed extra message, before last shoot -> death. I changed to SDKHook_OnTakeDamageAlive and now player health is before damage applies. Code:
... Using OnTakeDamagePost, again. I put check only victim health, not applied damage amount. Maybe it work now. #5 |
Re: In player_death Check for weapon_healthshot ?
Bacardi, it works!
This is a much cleaner and better solution. Thank you! |
Re: In player_death Check for weapon_healthshot ?
For clarify more, in my example it look through player weapons when player is dying.
But does actual healthshot drop happens ? Dunno. For example in CSGO deathmatch, those healthshots disappear when victim die. And on CSGO survived mode, dying player drop healtshot. So, your example could be much better. Dunno, can you check weapon_healthshot m_iOwner (or what was it name ?) on SDKHook WeaponDrop and check is player alive ? I have not tested. |
Re: In player_death Check for weapon_healthshot ?
1 Attachment(s)
Quote:
they definitely drop and you can pick them up. I only have these settings: ammo_item_limit_healthshot 4 mp_death_drop_healthshot 1 And a find on healthshot doesn't show any setting that would limit them so I don't know how they are limited in deathmatch other than mp_death_drop_healthshot 0 Quote:
3 Victim Brandon IsAlive= n PHP Code:
It has been well tested and working 100% 1) Randomly give health shots on round start to bots and humans 2) Disallow team bots to have shots (they will drop them on round start if given and humans and enemy bots can pick them up). 3) On death if victim has shot attacker will see a message and hear a sound. |
All times are GMT -4. The time now is 15:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.