The current method for creating and attaching the model (based on sm_hats among other things). animations are commented out since they dont work.
This desperately needs a cleanup
Code:
new ent =CreateEntityByName("prop_dynamic_override");
Parachute_Ent[client] = ent;
DispatchKeyValue(ent, "model", path);
DispatchKeyValue(ent, "spawnflags", "4");
SetEntProp(ent, Prop_Data, "m_CollisionGroup", 0);
SetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity", client);
AcceptEntityInput(ent, "TurnOn", ent, ent, 0);
AcceptEntityInput(ent, "EnableCollision");
SetEntityMoveType(ent, MOVETYPE_NOCLIP);
DispatchSpawn(ent);
ActivateEntity(ent);
hasModel[client]=true;
//TeleportParachute(client);
// animations just wont work... model is f***d up !
/*
SDKHook(ent, SDKHook_Spawn, SpawnChute);
SetVariantString("deploy");
AcceptEntityInput(ent, "SetAnimation", -1, -1, 0);
SetVariantString("idle");
AcceptEntityInput(ent, "SetDefaultAnimation", -1, -1, 0);
SetVariantFloat(1.0);
AcceptEntityInput(ent, "SetPlaybackRate", -1, -1, 0);
*/
TeleportEntity(ent, or, ang, NULL_VECTOR);
SetVariantString("!activator");
AcceptEntityInput(ent, "SetParent", client, ent, 0);
SetVariantString("primary");
AcceptEntityInput(ent, "SetParentAttachment", ent, ent, 0);
DispatchKeyValueVector(ent, "angles", ang);
DispatchKeyValueVector(ent, "origin", or);
SetVariantString("primary");
AcceptEntityInput(ent, "SetParentAttachmentMaintainOffset", ent, ent, 0);