This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

No model is spawning


Post New Thread Reply   
 
Thread Tools Display Modes
r00tage
Senior Member
Join Date: Nov 2008
Old 01-06-2011 , 13:15   Re: No model is spawning
Reply With Quote #11

Thank you all for the responses, I changed my code but still no luck! I made it non-solid and added a ActivateEntity.

Code:
CreateFlag(Float:vec[3], index)
{
	LogMessage("Creating flag");
	flagEnt[index] = CreateEntityByName("prop_dynamic_override");
	LogMessage("Flag Ent Index: %d", flagEnt[index]);
	if (flagEnt[index] != -1)
	{
		PrecacheModel("models/props/de_tides/turtle_rock_flag.mdl");
		DispatchKeyValue(flagEnt[index], "solid", "0");
		DispatchKeyValue(flagEnt[index], "model", "models/props/de_tides/turtle_rock_flag.mdl");
		DispatchSpawn(flagEnt[index]);
		SetEntityRenderMode(flagEnt[index],  RENDER_TRANSCOLOR);
		ActivateEntity(flagEnt[index]);
		new Float:ang[3];
		ang[2] = 45.0;
		TeleportEntity(flagEnt[index], vec, ang, NULL_VECTOR);
		LogMessage("Flag created %d at: %f %f %f", flagEnt[index], vec[0], vec[1], vec[2]);
		
		if (IsValidEntity(flagEnt[index]))
			LogMessage("Valid entity as well!");
	}
}

Here is the log output
Quote:
L 01/06/2011 - 12:03:09: [test.smx] Creating flag
L 01/06/2011 - 12:03:09: [test.smx] Flag Ent Index: 153
L 01/06/2011 - 12:03:09: [test.smx] Flag created 153 at: 1879.387207 2502.465087 -996.256958
L 01/06/2011 - 12:03:09: [test.smx] Valid entity as well!
L 01/06/2011 - 12:03:09: [test.smx] flag1
L 01/06/2011 - 12:03:09: [test.smx] Creating flag
L 01/06/2011 - 12:03:09: [test.smx] Flag Ent Index: 154
L 01/06/2011 - 12:03:09: [test.smx] Flag created 154 at: -14.349388 758.310180 -997.695922
L 01/06/2011 - 12:03:09: [test.smx] Valid entity as well!
L 01/06/2011 - 12:03:09: [test.smx] flag2
L 01/06/2011 - 12:03:09: [test.smx] Creating flag
L 01/06/2011 - 12:03:09: [test.smx] Flag Ent Index: 155
L 01/06/2011 - 12:03:09: [test.smx] Flag created 155 at: 1063.494384 -1967.127319 -910.968750
L 01/06/2011 - 12:03:09: [test.smx] Valid entity as well!
r00tage is offline
r00tage
Senior Member
Join Date: Nov 2008
Old 01-08-2011 , 12:14   Re: No model is spawning
Reply With Quote #12

Haha, sorry for the double post but a couple days ago I managed to fix the problem.

I was spawning the entities OnMapStart and not on RoundStart.

Thanks everyone for helping!
r00tage 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 16:06.


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