Raised This Month: $32 Target: $400
 8% 

[L4D2] Survivor healed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
midnight9
Senior Member
Join Date: Nov 2012
Old 06-18-2018 , 16:47   [L4D2] Survivor healed
Reply With Quote #1

Is there a way of checking if survivor has been healed by team mate/BOT other than hooking heal_success event?

Last edited by midnight9; 06-18-2018 at 16:48.
midnight9 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-18-2018 , 19:38   Re: [L4D2] Survivor healed
Reply With Quote #2

Quote:
Originally Posted by midnight9 View Post
Is there a way of checking if survivor has been healed by team mate/BOT other than hooking heal_success event?
Could you specify a reason not to hook it?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 06-19-2018 , 01:27   Re: [L4D2] Survivor healed
Reply With Quote #3

Quote:
Originally Posted by eyal282 View Post
Could you specify a reason not to hook it?
I need to create boolean determinating if survivor has been healed, so if i set the boolean to true using the event it will work but if the player leaves and new player joins and takes over the same survivor bot i assume then it will be false?

Last edited by midnight9; 06-19-2018 at 01:31.
midnight9 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-19-2018 , 08:00   Re: [L4D2] Survivor healed
Reply With Quote #4

Quote:
Originally Posted by midnight9 View Post
I need to create boolean determinating if survivor has been healed, so if i set the boolean to true using the event it will work but if the player leaves and new player joins and takes over the same survivor bot i assume then it will be false?
The event cannot fail, this event determines an ALREADY SUCCESSFUL HEAL and will not fire otherwise. Whatever bool you're using always set it to true. When the event is fired, the survivor now has 80 ( or more ) permanent health.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-19-2018 , 08:01   Re: [L4D2] Survivor healed
Reply With Quote #5

Reset the bool to false when they disconnect.
__________________
Silvers is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 06-19-2018 , 09:23   Re: [L4D2] Survivor healed
Reply With Quote #6

I dont think i can rely on that.
Lets say Player A plays as Ellis, another player heals player A (Ellis) so the bool will be true for player A, but then player A leaves the game and player B joins and takes over Ellis, so then bool will be false because its been set to true for player A that has left correct?
midnight9 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-19-2018 , 10:04   Re: [L4D2] Survivor healed
Reply With Quote #7

Check the netprops, could probably use these:

Quote:
CTerrorPlayer (type DT_TerrorPlayer)
Member: m_checkpointMedkitsUsed (offset 14644) (type integer) (bits 32)
Member: m_checkpointPillsUsed (offset 14648) (type integer) (bits 32)
Member: m_missionMedkitsUsed (offset 14652) (type integer) (bits 32)
Member: m_missionPillsUsed (offset 14656) (type integer) (bits 32)
Member: m_checkpointFirstAidShared (offset 14716) (type integer) (bits 32)
Member: m_missionFirstAidShared (offset 14720) (type integer) (bits 32)
__________________

Last edited by Silvers; 06-19-2018 at 10:04.
Silvers is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 06-19-2018 , 11:20   Re: [L4D2] Survivor healed
Reply With Quote #8

I've tried some chat print debug:
Code:
new FirstAidSharedCheckpoint = GetEntProp(client, Prop_Send, "m_checkpointFirstAidShared");
new FirstAidSharedMission = GetEntProp(client, Prop_Send, "m_missionFirstAidShared");
new HealOwner = GetEntProp(client, Prop_Send, "m_healOwner");
new HealTarget = GetEntProp(client, Prop_Send, "m_healTarget");
But m_checkpointFirstAidShared and m_missionFirstAidShared just returns 0, and m_healOwner throws error:

Code:
[SM] Exception reported: Property "m_healOwner" not found (entity 1/player)
Am i doing it wrong?
midnight9 is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-19-2018 , 11:55   Re: [L4D2] Survivor healed
Reply With Quote #9

Quote:
Originally Posted by midnight9 View Post
I've tried some chat print debug:
Code:
new FirstAidSharedCheckpoint = GetEntProp(client, Prop_Send, "m_checkpointFirstAidShared");
new FirstAidSharedMission = GetEntProp(client, Prop_Send, "m_missionFirstAidShared");
new HealOwner = GetEntProp(client, Prop_Send, "m_healOwner");
new HealTarget = GetEntProp(client, Prop_Send, "m_healTarget");
But m_checkpointFirstAidShared and m_missionFirstAidShared just returns 0, and m_healOwner throws error:

Code:
[SM] Exception reported: Property "m_healOwner" not found (entity 1/player)
Am i doing it wrong?
First of all L4D2 has no m_healOwner/target netprop/dataprop. That checkpoint netprop could have been stripped in the game.
Visual77 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-19-2018 , 11:56   Re: [L4D2] Survivor healed
Reply With Quote #10

Code:
new HealOwner = GetEntPropEnt(client, Prop_Send, "m_healOwner");
new HealTarget = GetEntPropEnt(client, Prop_Send, "m_healTarget");
The others I don't know.
__________________
Silvers is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode