SOLUTION:
Store that animation lib and name in a variable.
e.g. :
I use GetAnimationName() function but it only returns PED, IDLE_STANCE or PED,SEAT_IDLE or PED,WOMAN_IDLESTANCE.
When i apply another animations like /eat, /sit, /lay
this function not give me the applied animation animlib and animname but just return PED, IDLE_STANCE.
In other gamemodes that I test, this problem does not occur.
I need to fix this problem quickly.
thanks for the anyone answer.
Store that animation lib and name in a variable.
e.g. :
Code:
new rAnimLib[MAX_PLAYERS][20];
new rAnimName[MAX_PLAYERS][20];
COMMAND:anim(playerid, params[]) {
? ? ApplyAnimation(playerid, "PED", "IDLE_STANCE", 4.1, 0, 0, 0, 0, 0);
? ? rAnimLib[playerid] = "PED";
? ??rAnimName[playerid] = "IDLE_STANCE";
? ? return 1;
}
GetAnimationNameEx(playerid, Lib[20], Name[20])
{
? ? Lib = rAnimLib[playerid];
? ? Name = rAnimName[playerid];
}
//use this method instead of GetAnimationName.
I use GetAnimationName() function but it only returns PED, IDLE_STANCE or PED,SEAT_IDLE or PED,WOMAN_IDLESTANCE.
When i apply another animations like /eat, /sit, /lay
this function not give me the applied animation animlib and animname but just return PED, IDLE_STANCE.
PHP Code:
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1, 0, 1, 1, 1, 1, 1); // Sit
ApplyAnimation(playerid,"BEACH", "bather",4.1, 0, 1, 1, 1, 1, 1); // Lay down
CMD:anim(playerid) {
? ? if(GetPlayerAnimationIndex(playerid))
{
? ? new animlib[32];
? ? new animname[32];
? ? new msg[128];? ?
? ? GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
? ? format(msg, 128, "Running anim: %s %s", animlib, animname);
? ? SendClientMessage(playerid, -1, msg); // output is: PED IDLE_STANCE
}
? ? return 1;
}
In other gamemodes that I test, this problem does not occur.
I need to fix this problem quickly.
thanks for the anyone answer.