Hello, I trying apply animation for chicken. But I cant reset this animation
How to reset SetAnimation?
I tried SetAnimationNoReset, SetDefAnimation. When I apply "idle" animation chicken wont move and follow me
PHP Code:
if ((chicken = CreateEntityByName("chicken")) != -1)
{
DispatchKeyValue(chicken , "targetname", "chicken_controlled");
DispatchSpawn(chicken);
TeleportEntity(chicken, ChickenCoord, NULL_VECTOR, NULL_VECTOR);
ActivateEntity(chicken);
}
new Float:client_pos[3], Float:start_pos[3];
GetClientAbsOrigin(client,client_pos);
GetEntPropVector(chicken, Prop_Send, "m_vecOrigin", start_pos);
new Float:dist_check=GetVectorDistance(client_pos,start_pos);
if(dist_check<100.0)
{
SetVariantString("flap");
AcceptEntityInput(chicken, "SetAnimation");
inanim=1;
}
else
{
if(inanim)
{
SetVariantString("idle");
AcceptEntityInput(chicken, "SetAnimation");
inanim=0;
}
}