Raised This Month: $51 Target: $400
 12% 

[L4D]infected claw damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZBzibing
Senior Member
Join Date: Dec 2012
Old 12-02-2021 , 17:19   [L4D]infected claw damage
Reply With Quote #1

We played a cooperative model, improve the fun of the game by adding more special infections. But the hurt of the infected paws is too high, how do we limit it?

invalid code
Code:
hunter_pz_claw_dmg 1
smoker_pz_claw_dmg 1
boomer_pz_claw_dmg 1
sm_cvar hunter_pz_claw_dmg 1
sm_cvar smoker_pz_claw_dmg 1
sm_cvar boomer_pz_claw_dmg 1
This problem has been troubled me
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 12-02-2021 , 20:23   Re: [L4D]infected claw damage
Reply With Quote #2

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


public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype)
{
    if(!
IsClientAndInGame(victim) || !IsClientAndInGame(attacker) || !IsValidEdict(inflictor) || damage == 0.0) { return Plugin_Continue; }

    if (
GetClientTeam(victim) == && GetClientTeam(attacker) == 3)
    {
        
int zombie_class GetZombieClass(attacker);
        
int hasvictim L4D_GetSurvivorVictim(attacker);
        if(
zombie_class != && hasvictim != victim//not tank and claw damage
        
{
                
damage 10.0//modify damage here.
                
PrintToChatAll("attacker %N - claw damage: %f - class: %d"attackerdamagezombie_class);
                return 
Plugin_Changed;
        }
    }
    return 
Plugin_Continue;
}

int GetZombieClass(int client
{
    return 
GetEntProp(clientProp_Send"m_zombieClass");
}

bool IsClientAndInGame(int index)
{
    if (
index && index MaxClients)
    {
        return 
IsClientInGame(index);
    }
    return 
false;
}

int L4D_GetSurvivorVictim(int client)
{
    
int victim;

    
/* Hunter */
    
victim GetEntPropEnt(clientProp_Send"m_pounceVictim");
    if (
victim 0)
    {
        return 
victim;
     }

    
/* Smoker */
     
victim GetEntPropEnt(clientProp_Send"m_tongueVictim");
    if (
victim 0)
    {
        return 
victim;    
    }

    return -
1;

__________________
HarryPotter is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 12-04-2021 , 06:05   Re: [L4D]infected claw damage
Reply With Quote #3

Applause, cheers, he has worked, thank you very much
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing 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 05:00.


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