If it's just a clone, you can just create a 0.1 second repeating timer and in there, get the real player's current sequence (not sure if the animation is included) and apply it to the clone.
Note: You must record the created clone first or you will have a hard time to figure it out.
PHP Code:
int cloneEnt[client];
void CreateClone(int client)
{
float clientOrigin[3], clientAngles[3];
GetEntPropVector(client, Prop_Send, "m_vecOrigin", clientOrigin);
GetClientEyeAngles(client, clientAngles);
int EntIndex = CreateEntityByName("prop_dynamic_override");
DispatchKeyValue(EntIndex, "model", "models/player/custom_player/legacy/ctm_idf.mdl");
TeleportEntity(EntIndex, clientOrigin, clientAngles, NULL_VECTOR);
DispatchSpawn(EntIndex);
cloneEnt[client] = EntIndex;
CreateTimer(0.1, ProcessClone, client, TIMER_REPEAT);
}
public Action ProcessClone(Handle timer, any client)
{
if (!IsClientInGame(client))
{
RemoveClone(client); // remove the clone if client leaves..
return Plugin_Stop;
}
if (cloneEnt[client] <= 0 || !IsValidEntity(cloneEnt[client]) || !IsValidEdict(cloneEnt[client])
{
return Plugin_Stop; // if clone doesn't exist..
}
int clientSequence = GetEntProp(client, Prop_Send, "m_nSequence");
float currentOrigin[3], currentAngles[3];
GetEntPropVector(client, Prop_Send, "m_vecOrigin", currentOrigin);
GetClientEyeAngles(client, currentAngles[3];
SetEntProp(cloneEnt[client], Prop_Send, "m_nSequence", clientSequence);
TeleportEntity(cloneEnt[client], currentOrigin, currentAngle, NULL_VECTOR);
return Plugin_Continue;
}
void RemoveClone(int client)
{
if (cloneEnt[client] <= 0 || !IsValidEntity(cloneEnt[client]) || !IsValidEdict(cloneEnt[client])
{
return;
}
AcceptEntityInput(cloneEnt[client], "Kill");
cloneEnt[client] = 0;
}