View Single Post
Author Message
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 08-04-2018 , 16:15   Problem with prop_ragdoll
Reply With Quote #1

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.
__________________
My Steam I take private requests if related with TF2
My Plugins

Last edited by Facksy; 08-04-2018 at 16:17.
Facksy is offline