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

Entity doesn't have gravity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dawid35456
Junior Member
Join Date: Mar 2012
Old 06-08-2017 , 15:56   Entity doesn't have gravity
Reply With Quote #1

I created entity which is placed on the air. I've got little problem because that entity doesn't have gravity. Can anyone show me what did I wrong? Thanks

Code:
	int iEnt = CreateEntityByName("prop_physics_override");
	if (iEnt == -1)
		return;
		
	DispatchKeyValue(iEnt, "classname", "skrzynka");
	DispatchKeyValue(iEnt, "model", "models/props_crates/static_crate_40.mdl");
	DispatchSpawn(iEnt);
	//ActivateEntity(iEnt);
	//SetEntityModel(iEnt, "models/props_crates/static_crate_40.mdl");
	SetEntProp(iEnt, Prop_Send, "m_nSolidType", 2);
	SetEntProp(iEnt, Prop_Data, "m_CollisionGroup", 0); 
	SetEntPropEnt(iEnt, Prop_Send, "m_hOwnerEntity", cId);
	SetEntityMoveType(iEnt, MOVETYPE_FLYGRAVITY);
	SetEntityGravity(iEnt, 0.5);
	float minbounds[3] = {-16.0, -16.0, 0.0};
	float maxbounds[3] = {16.0, 16.0, 16.0};
	SetEntPropVector(iEnt, Prop_Send, "m_vecMins", minbounds);
	SetEntPropVector(iEnt, Prop_Send, "m_vecMaxs", maxbounds);
	//fPozycja[1] -= 200.0;
	TeleportEntity(iEnt, fPozycja, NULL_VECTOR, NULL_VECTOR);
dawid35456 is offline
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Old 06-09-2017 , 10:16   Re: Entity doesn't have gravity
Reply With Quote #2

tried this a long time ago - not all props work with gravity

Your best bet is to create a 0.1 timer and set the velocity to what you want
__________________
Notable Projects:
Event Item Spawner | Scissors, Rock, Paper for ZephStore
tVip | Smart Link Remover
PLG & GGC - CS:GO Roleplay

and countless more...

I can make a helicopter shoot missles if you want me to...
Totenfluch is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-09-2017 , 16:28   Re: Entity doesn't have gravity
Reply With Quote #3

Try to set the speed one frame after you create and spawn the entity.
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
w1200441
Senior Member
Join Date: Dec 2011
Old 06-12-2017 , 06:10   Re: Entity doesn't have gravity
Reply With Quote #4

This is how I put entity on air in my parkour server.

Code:
new prop = CreateEntityByName("prop_dynamic");
if (IsValidEntity(prop))
{
	DispatchKeyValue(prop, "targetname", "ParkourEntity");
	DispatchKeyValue(prop, "model", "models/props_crates/static_crate_40.mdl");
	DispatchKeyValue(prop, "origin", "2485 5565 2440");
	DispatchKeyValue(prop, "angles", "0 0 0");
	DispatchKeyValue(prop, "solid", "6");
	DispatchSpawn(prop); 
}
w1200441 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:41.


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