I tried parent entity(with player model) to player.
but, i have problem. (look at picture)
I want to do parent to player. So, i should parent position with GetClientAbsOrigin position.
but, SetParentAttachment don't have respond to GetClientAbsOrigin position.
My Source Code:
Code:
float pos[3], angle[3];
GetClientAbsOrigin(client, pos);
GetClientEyeAngles(client, angle);
angle[0] = 0.0;
m_MyCycler[client] = CreateEntityByName("prop_dynamic_override");
DispatchKeyValue(m_MyCycler[client], "model", _ModelName);
DispatchKeyValue(m_MyCycler[client], "spawnflags", "256");
DispatchKeyValue(m_MyCycler[client], "solid", "0");
SetEntPropEnt(m_MyCycler[client], Prop_Send, "m_hOwnerEntity", client);
DispatchSpawn(m_MyCycler[client]);
SetEntityRenderMode(m_MyCycler[client], RENDER_TRANSCOLOR);
//SetEntityRenderColor(m_MyCycler[client], 255, 255, 255, 0);
TeleportEntity(m_MyCycler[client], pos, angle, NULL_VECTOR);
AcceptEntityInput(m_MyCycler[client], "TurnOn", m_MyCycler[client], m_MyCycler[client], 0);
SetVariantString("!activator");
AcceptEntityInput(m_MyCycler[client], "SetParent", client, m_MyCycler[client], 0);
ActivateEntity(m_MyCycler[client]);
Sorry for my bad English