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!
|