Raised This Month: $ Target: $400
 0% 

[L4D2] Disable rock damage on tank


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-29-2022 , 06:46   Re: [L4D2] Disable rock damage on tank
Reply With Quote #1

I have not tested.

But it look player who attack himself with projectile, then look team, finally look player class is Tank.
Plugin block damage.

PHP Code:
enum {
    
team_none 0,
    
team_spec,
    
team_survivors,
    
team_infected
};

enum {
    
Infected 0,
    
Smoker,
    
Boomer,
    
Hunter,
    
Spitter,
    
Jockey,
    
Charger,
    
unknown,
    
Tank,
    
Survivor,
    
Witch
};

//char infected[][] = {
//    "Infected",
//    "Smoker",
//    "Boomer",
//    "Hunter",
//    "Spitter",
//    "Jockey",
//    "Charger",
//    "unknown",
//    "Tank",
//    "Survivor",
//    "Witch"
//}

#include <sdkhooks>

public void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
}


public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype)
{
    
// player attack himself with projectile
    
if(!(victim == attacker &&
        
attacker != inflictor))
            return 
Plugin_Continue;

    if(
GetClientTeam(victim) != team_infected)
        return 
Plugin_Continue;


    
//char buffer[15];
    
int m_zombieClass 0;

    if(
HasEntProp(victimProp_Send"m_zombieClass"))
    {
        
m_zombieClass GetEntProp(victimProp_Send"m_zombieClass");
    }
    
//else
    //{
    //    GetEntityClassname(victim, buffer, sizeof(buffer));
    //
    //    if(StrEqual(buffer, infected[Witch], false))
    //        m_zombieClass = Witch; // this class is now customized manually...
    //}

    
switch(m_zombieClass)
    {
        case 
Infected:
        {
        }
    
        case 
Tank:
        {
            return 
Plugin_Handled;
        }
    }

    return 
Plugin_Continue;

__________________
Do not Private Message @me
Bacardi 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 03:23.


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