• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [Solved] GetAnimationName() is not working properly
#1
SOLUTION:

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.1011111); // Sit

ApplyAnimation(playerid,"BEACH""bather",4.1011111); // 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(msg128"Running anim: %s %s"animlibanimname);

? ? 
SendClientMessage(playerid, -1msg); // 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.
  Reply


Messages In This Thread
[Solved] GetAnimationName() is not working properly - by Radical - 2021-03-23, 08:43 PM

Forum Jump: