Raised This Month: $ Target: $400
 0% 

[REQ][L4D2] no FF damage towards incapped survivors and bot fire immunity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rogilla
Junior Member
Join Date: Aug 2019
Old 09-05-2019 , 02:37   [REQ][L4D2] no FF damage towards incapped survivors and bot fire immunity
Reply With Quote #1

Looking for a plugin for no friendly fire damage when you shoot an incapped survivor teammate.

And secondly, fire immunity for bots only.

Any help will be appreciated. Thanks!
Rogilla is offline
Rogilla
Junior Member
Join Date: Aug 2019
Old 09-06-2019 , 18:36   Re: [REQ][L4D2] no FF damage towards incapped survivors and bot fire immunity
Reply With Quote #2

Tried to modify xQd's existing 'tougher survivor bots' plugin to accomplish no ff damage to incapped survivors.
My first time trying, but I don't know where I went wrong after several attempts.
It compiles fine, but functionally doesn't work. Anybody know?

PHP Code:
public OnClientPutInServer(client)

    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage); 


public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype

&
weaponFloat:damageForce[3], Float:damagePosition[3])
{
    if (
victim && attacker && GetClientTeam(attacker) == && GetClientTeam

(victim) == && damagetype == && IsClientIncapacitated(victim)) 
    {  
     
damage 0.0;
    }
}

public 
bool:IsClientIncapacitated(client)
{
    return 
GetEntProp(clientProp_Send"m_isIncapacitated") != || GetEntProp (clientProp_Send"m_isHangingFromLedge") != 0;

Rogilla is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 09-06-2019 , 20:35   Re: [REQ][L4D2] no FF damage towards incapped survivors and bot fire immunity
Reply With Quote #3

Untested

PHP Code:
#pragma newdecls required

#include <sourcemod>
#include <sdkhooks>

public void OnClientPutInServer(int client)

    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage); 


public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &ammotypeint hitboxint hitgroup)
{
    if ((
damagetype == || damagetype == 268435464 || damagetype == 131072 || damagetype == 2056) && victim <= MaxClients && victim && IsFakeClient(victim))
    {
        
damage 0.0;
        return 
Plugin_Changed;
    }
    else if (
attacker && attacker <= MaxClients && GetClientTeam(attacker) == && victim && victim <= MaxClients && GetClientTeam(victim) == && IsClientIncapacitated(victim))
    {
        
damage 0.0;
        return 
Plugin_Changed;
    }
    return 
Plugin_Continue;
}

bool IsClientIncapacitated(int client)
{
    return 
GetEntProp(clientProp_Send"m_isIncapacitated") != || GetEntProp (clientProp_Send"m_isHangingFromLedge") != 0;

__________________
cry

Last edited by BHaType; 09-06-2019 at 21:01.
BHaType is offline
Send a message via AIM to BHaType
Rogilla
Junior Member
Join Date: Aug 2019
Old 09-06-2019 , 23:01   Re: [REQ][L4D2] no FF damage towards incapped survivors and bot fire immunity
Reply With Quote #4

thanks for the reply!! it's been working for the most part! although i've only been able to test on bots.

only bots have fire immunity; i'm still incurring damage myself. ty! this is exactly what i was looking for.

However, incapped bots and hanging from ledge bot will not lose health and remains at 100%, unless attacked by infected. Edit: I removed damagetype == 131072 poison damage to resolve it, but is there any other function to leave it in there?

Last edited by Rogilla; 09-07-2019 at 00:10. Reason: further testing
Rogilla is offline
Reply



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 22:05.


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