Raised This Month: $32 Target: $400
 8% 

[CS:GO] Straight


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 02-27-2015 , 13:21   [CS:GO] Straight
Reply With Quote #1

Code:
public DoKnife(client)
{
	new ent;

	if((ent = CreateEntityByName("prop_physics")) != -1)
	{
		GetClientEyePosition(client, fPos);
		GetClientEyeAngles(client, fAng);
		
		Format(targetname, sizeof(targetname), "Throwning Knife", ent);
		Format(Buffer, sizeof(Buffer), "Ent%d", ent);
		
		SetEntityGravity(ent, 0.0);
		DispatchKeyValue(ent, "model", KNIFE_MDL);
		//DispatchKeyValue(ent, "physicsmode", "1"); // Non-Solid, Server-side
		//DispatchKeyValue(ent, "massScale", "1.0"); // A scale multiplier for the object's mass.
		DispatchKeyValue(ent, "targetname", targetname); // The name that other entities refer to this entity by.
		
		GetAngleVectors(fAng, fVel, NULL_VECTOR, NULL_VECTOR);
		NormalizeVector(fVel, fpAng);
		ScaleVector(fpAng, 1500.0);
		GetEntPropVector(client, Prop_Data, "m_vecVelocity", fPVel);
                DispatchSpawn(ent); // Spawn
		TeleportEntity(ent, fPos, fAng, fpAng);
	}
}
I ant that knife will go in straight line. It fall down, how to do this?
Screeaam.. is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 02-27-2015 , 13:28   Re: [CS:GO] Straight
Reply With Quote #2

YOu could set it's gravity (SetEntityGravity) to 0.0, then when it hits a wall set it to 1.0.
Mitchell is offline
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 02-27-2015 , 13:55   Re: [CS:GO] Straight
Reply With Quote #3

I tried that but it doesnt work.. :/
Screeaam.. is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-27-2015 , 14:08   Re: [CS:GO] Straight
Reply With Quote #4

What if you set movetype to MOVETYPE_FLY?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 02-28-2015 , 10:52   Re: [CS:GO] Straight
Reply With Quote #5

Still doesn't work..
Screeaam.. is offline
Reply


Thread Tools
Display Modes

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:43.


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