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

[CS:GO] Damage only on ground


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 03-01-2015 , 10:52   [CS:GO] Damage only on ground
Reply With Quote #1

Code:
public Knife(client)
{
	new ent;
	if((ent = CreateEntityByName("prop_physics_override")) != -1)
	{
		decl Float:fPos[3], Float:fAng[3], Float:fVel[3], Float:fPVel[3], String:targetname[100], String:Buffer[64];
	
		GetClientEyePosition(client, fPos);
		GetClientEyeAngles(client, fAng);
		
		Format(targetname, sizeof(targetname), "Knife");
		Format(Buffer, sizeof(Buffer), "Ent%d", ent);
		SetEntityModel(ent, KNIFE_MDL); 
		
		GetAngleVectors(fAng, fVel, NULL_VECTOR, NULL_VECTOR);
		ScaleVector(fVel, 3500.0);
		GetEntPropVector(client, Prop_Data, "m_vecVelocity", fPVel);
		AddVectors(fVel, fPVel, fVel);
		
		
		if(IsValidEntity(ent))
		{ 
			if(DispatchSpawn(ent))
			{
				SDKHook(ent, SDKHook_StartTouch, StartTouch);
				TeleportEntity(ent, fPos, fAng, fVel);
			}
		}
	}
}

public StartTouch(caller,activator)
{
	if (activator >= 1 && activator <= MaxClients) 
	{ 
		if (IsPlayerAlive(activator) && IsValidEdict(caller)) 
		{ 
			RemoveEdict(caller); 
			SDKHooks_TakeDamage(activator, activator, activator, 100000.0, DMG_GENERIC, -1)
			PrintToChat(activator, "TOUCH!");
		} 
	} 
}
I have problem. Touch work when knife land on the ground, when Knife is on ground and I go on it, than it kills me. But when knife go throw enemy it doesn't work. Why? I tried SDKHook_StartTouch and SDKHook_Touch.
Screeaam.. is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-01-2015 , 15:38   Re: [CS:GO] Damage only on ground
Reply With Quote #2

Everyone is going nuts on throwing knives.
__________________
Neuro Toxin is offline
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 03-01-2015 , 17:56   Re: [CS:GO] Damage only on ground
Reply With Quote #3

I Just wanna know how to fix this touch.
Screeaam.. is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-02-2015 , 14:11   Re: [CS:GO] Damage only on ground
Reply With Quote #4

Quote:
Originally Posted by Screeaam.. View Post
I Just wanna know how to fix this touch.
Same here I've been using your source you posted prior to this and trying to figure it out x.x
It's something with you have to make it so while the entity is flying through the air it is constantly updating the damage thingy. OR you could add an invis explosion with no sound that is a 2x2 radius (CSGO player model I think) and that would work too
Brrdy is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-02-2015 , 15:18   Re: [CS:GO] Damage only on ground
Reply With Quote #5

Tbh. I spawn a trigger multiple around the knife entity ;)
__________________
Neuro Toxin is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-02-2015 , 16:04   Re: [CS:GO] Damage only on ground
Reply With Quote #6

Quote:
Originally Posted by Neuro Toxin View Post
Tbh. I spawn a trigger multiple around the knife entity ;)
Neuro do ittttt
Brrdy 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:07.


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