Raised This Month: $319 Target: $400
 79%   Almost there!

Solved [L4D2]How to add damage sources to flying objects (containers, cars, truck)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
a2121858
Member
Join Date: Sep 2020
Old 09-17-2021 , 10:09   [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #1

I want that characters other than tanks can calculate the damage caused by hitting flying objects, etc. (containers, cars, trucks).

For example, when I use this Plugins
https://forums.alliedmods.net/showthread.php?t=126831

In versus mode, when the charger hits the car and hits the survivor, the panel will not calculate the damage.

I try to add
PHP Code:
SetEntPropEnt(i_TargetProp_Send"m_hOwnerEntity"client); 
But it didn't work, can anyone help me?

Last edited by a2121858; 09-18-2021 at 09:33.
a2121858 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 09-17-2021 , 11:24   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #2

Can't understand what you are trying to say, be more clear.

Check if this is what you are looking for l4d2_hittable_control

This plugin allows changing the damage from hittables

If you want to block the damage from charger hittables then I think you need to store somewhere which infected did the last hit, and check if is a charger, ignore the damage.
__________________

Last edited by Marttt; 09-17-2021 at 11:26.
Marttt is offline
a2121858
Member
Join Date: Sep 2020
Old 09-17-2021 , 12:12   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #3

Quote:
Originally Posted by Marttt View Post
Can't understand what you are trying to say, be more clear.

Check if this is what you are looking for l4d2_hittable_control

This plugin allows changing the damage from hittables

If you want to block the damage from charger hittables then I think you need to store somewhere which infected did the last hit, and check if is a charger, ignore the damage.
Sorry, my English is not good.
When i use this pluginCharger Power.

In versus mode:

Charger uses its abilities to move cars and cause damage to survivors. The Tab panel does not calculate this damage score, But if the tank fist moves the car and causes damage to the survivors, the Tab panel calculates the damage score.

I need to move the car in charger, and the Tab panel will calculate the damage score.

Thank you for your reply, Mr. Marttt.
a2121858 is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 09-17-2021 , 12:24   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #4

You set the "m_hPhysicsAttacker" to the client who last hit it, or maybe "m_hLastAttacker" but I believe it's the former. Then it should credit who hit the object with kills/damage. Some datamap variable like that. Don't have time to check.
__________________
Silvers is offline
a2121858
Member
Join Date: Sep 2020
Old 09-17-2021 , 12:41   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #5

Quote:
Originally Posted by Silvers View Post
You set the "m_hPhysicsAttacker" to the client who last hit it, or maybe "m_hLastAttacker" but I believe it's the former. Then it should credit who hit the object with kills/damage. Some datamap variable like that. Don't have time to check.
Thank you for your help, Mr. Silvers.
But after testing, I got this error.
Code:
Exception reported: Property "m_hPhysicsAttacker" not found (entity 116/prop_physics)
Exception reported: Property "m_hLastAttacker" not found (entity 108/prop_physics)
PHP Code:
SetEntPropEnt(i_TargetProp_Send"m_hPhysicsAttacker"i_Client); 
SetEntPropEnt(i_TargetProp_Send"m_hLastAttacker"i_Client); 
a2121858 is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 09-17-2021 , 12:45   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #6

datamap not sendprop. Prop_Data.
__________________
Silvers is offline
a2121858
Member
Join Date: Sep 2020
Old 09-17-2021 , 13:12   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #7

Quote:
Originally Posted by Silvers View Post
datamap not sendprop. Prop_Data.
sorry sir. I am stupid.

Should it be used like this?
PHP Code:
SetEntPropEnt(i_TargetProp_Data"m_hPhysicsAttacker"i_Client); 
There is no error, but no effect, "m_hPhysicsAttacker" or "m_hLastAttacker", I don't know if it is my problem.
a2121858 is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 09-17-2021 , 14:25   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #8

Yeah, where are you putting the code?

Edit: I do this in one of my plugins:
PHP Code:
elay)
{
    
SetEntPropEnt(entityProp_Data"m_hPhysicsAttacker"client);
    
SetEntPropFloat(entityProp_Data"m_flLastPhysicsInfluenceTime"GetGameTime()); 
I think that last line might be required, I see it in a few of mine like this.
__________________

Last edited by Silvers; 09-17-2021 at 14:28.
Silvers is offline
a2121858
Member
Join Date: Sep 2020
Old 09-17-2021 , 22:31   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #9

Quote:
Originally Posted by Silvers View Post
Yeah, where are you putting the code?

Edit: I do this in one of my plugins:
PHP Code:
elay)
{
    
SetEntPropEnt(entityProp_Data"m_hPhysicsAttacker"client);
    
SetEntPropFloat(entityProp_Data"m_flLastPhysicsInfluenceTime"GetGameTime()); 
I think that last line might be required, I see it in a few of mine like this.
I did this, before moving the object.
PHP Code:
float f_Velocity[3], f_Power;

GetAngleVectors(f_Anglesf_VelocityNULL_VECTORNULL_VECTOR);
f_Power g_h_CvarChargerPower.FloatValue;
f_Velocity[0] *= f_Power;
f_Velocity[1] *= f_Power;
f_Velocity[2] *= f_Power;
SetEntPropEnt(i_TargetProp_Data"m_hPhysicsAttacker"i_Client); 
TeleportEntity(i_TargetNULL_VECTORNULL_VECTORf_Velocity); 
I will try the new method later, thank you.
a2121858 is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 09-17-2021 , 22:37   Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
Reply With Quote #10

Yep that seems right, just add in setting float and give it a go. I remember I fixed this in some 3rd party plugin, guess it wasn't this. Hmm.
__________________
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 20:46.


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