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

Solved [L4D2] Setting Damage dealt to witch


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lightphoenix2
Member
Join Date: Feb 2016
Old 01-29-2021 , 08:22   Re: [L4D2] Setting Damage dealt to witch
Reply With Quote #11

Code:
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
	if(GetEntityClassname(victim, "witch", 10) && attacker > 0 && GetClientTeam(attacker) == 2 && g_iLevel[attacker] > 0 && attacker <= MaxClients && victim > MaxClients)
	{
		damage = GetRandomFloat(criMulMin, criMulMAX) * damage + 1;
		Knockback(attacker, victim, CritForce, 1.5, 2.0);
		if (CritPrint)
		{
			PrintToChat(attacker, "\x01Critical!\x03 %.2f\x01 damage", damage);
		}
		return Plugin_Changed;
	}
	if (attacker > 0 && attacker <= MaxClients && GetClientTeam(attacker) == 2 && g_iLevel[attacker] > 0)
	{
		if (GetClientTeam(victim) == 2)
		{
			return Plugin_Continue;
		}
		damage = GetRandomFloat(criMulMin, criMulMAX) * damage + 1;
		if (CritPrint)
		{
			PrintToChat(attacker, "\x01Critical!\x03 %.2f\x01 damage", damage);
		}
		
		Knockback(attacker, victim, CritForce, 1.5, 2.0);
		return Plugin_Changed;
	}
	return Plugin_Continue;
}
GetEntityClassname(victim, "witch", 10) also works for any special infected, I don't know why.
I need another if statement on top to make the plugin work, I also don't know why.

Last edited by lightphoenix2; 01-29-2021 at 08:23.
lightphoenix2 is offline
 



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 04:03.


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