hello guys im actually trying to create a prop_ragdoll and to set velocity on it on spawn but something weird happen instead, here is the code:
Code:
void CreateRagdoll(float ori[3])
{
int dynamic = CreateEntityByName("prop_ragdoll");
DispatchKeyValue(dynamic, "model", "models/player/demo.mdl");
//DispatchKeyValue(dynamic, "spawnflags", "4");
DispatchKeyValue(dynamic, "skin", "0");
ActivateEntity(dynamic);
DispatchSpawn(dynamic);
float vel[3];
vel[0] = GetRandomFloat(300.0, 400.0);
vel[1] = GetRandomFloat(300.0, 400.0);
vel[2] = GetRandomFloat(3000.0, 4000.0);
TeleportEntity(dynamic, ori, NULL_VECTOR, vel);
}
Here the prop spawn with no velocity and when I jump on it I receive this velocity.
__________________