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

Prop damage and patency of bullets


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extr1m725
Member
Join Date: Oct 2014
Old 04-22-2017 , 08:25   Prop damage and patency of bullets
Reply With Quote #1

I try to make prop susceptible to damage and at the same time that bullets pass through it

Who can tell how it can be implemented?

Code:
int CreateGift(const Float:pos[3], client)
{
	if ((ent = CreateEntityByName("prop_physics_override")) != -1)
	{
		decl String:tmp[64];

		FormatEx(tmp, sizeof(tmp), "gift_%i", ent);

		DispatchKeyValue(ent, "model", "models/props/de_vertigo/concretebags2.mdl");
		DispatchKeyValue(ent, "massScale", "0.5");
		DispatchKeyValue(ent, "targetname", tmp);
		DispatchKeyValue(ent, "spawnflags", "1");
		DispatchSpawn(ent);

		SetEntProp(ent, Prop_Send, "m_usSolidFlags", 1);	
		SetEntProp(ent, Prop_Send, "m_CollisionGroup", 2);
		SetEntProp(ent, Prop_Data, "m_takedamage", 2, 1);
		SetEntProp(ent, Prop_Data, "m_iHealth", 300);
		SetEntPropEnt(ent, Prop_Send, "m_hEffectEntity", client);
		
		TeleportEntity(ent, pos, NULL_VECTOR, NULL_VECTOR);
		SetEntityMoveType(ent, MOVETYPE_NONE);
		
		CreateTimer(0.0, Ven, ent, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
		
		SDKHook(ent, SDKHook_OnTakeDamage, OnTakeDamage);
		
		return ent
	}
	return -1
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
	if (0 < attacker <= MaxClients)
	{
		new client = GetEntPropEnt(victim, Prop_Send, "m_hOwnerEntity");
		if ((client != attacker) && IsPlayerAlive(attacker))
		{
			return Plugin_Handled;
		}
		return Plugin_Continue;
	}
	
	return Plugin_Continue;
}

Last edited by extr1m725; 04-22-2017 at 08:27.
extr1m725 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 09:30.


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