ApplyActorAnimation crashes my game
#1

Im making my pizza stack system, and i have ApplyActorAnimation like to grab the meal from that bar like from singleplayer. Yet whenever i step on the checkpoint and the actor is about to do the animation, my gta crashes. This works on other servers, but apparently not on mine. Something is missing.

Code:
ApplyActorAnimation(PizzaActor, "SHP_Tray_In", "SHP_Tray_Lift_Out", 4.1, 0, 0, 0, 0, 0); //I assume this is the animation, but im not sure.
Reply
#2

Preload the animation before executing. (I still see no reason for a game crash)
Reply
#3

Quote:
Originally Posted by TheToretto
View Post
Preload the animation before executing. (I still see no reason for a game crash)
Where do i put these?
Code:
  
PreloadAnimLib(playerid,"SHP_Tray_In");
PreloadAnimLib(playerid,"SHP_Tray_Lift_Out");
Reply
#4

Quote:

An invalid animation library will crash the player's game.
SHP_Tray_In and SHP_Tray_Lift_Out are animation names and FOOD is their animation library.

https://sampwiki.blast.hk/wiki/Animations
Reply
#5

Quote:
Originally Posted by Calisthenics
View Post
SHP_Tray_In and SHP_Tray_Lift_Out are animation names and FOOD is their animation library.

https://sampwiki.blast.hk/wiki/Animations
So i assume this is the solution?
Code:
ApplyActorAnimation(PizzaActor, "FOOD", "SHP_Tray_In", 4.1, 0, 0, 0, 0, 0);
Reply
#6

Quote:
Originally Posted by Mike861
View Post
So i assume this is the solution?
Code:
ApplyActorAnimation(PizzaActor, "FOOD", "SHP_Tray_In", 4.1, 0, 0, 0, 0, 0);
Correct.
Reply
#7

Quote:
Originally Posted by Mike861
View Post
Where do i put these?
Code:
  
PreloadAnimLib(playerid,"SHP_Tray_In");
PreloadAnimLib(playerid,"SHP_Tray_Lift_Out");
No you preload a whole animation library not one by one, in this case thanks to Calisthenics:

pawn Code:
PreloadAnimLib(playerid,"SHOP");
Don't forget to define it:

pawn Code:
PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
Reply
#8

Quote:
Originally Posted by Calisthenics
View Post
Correct.
Thanks it works, but is it possible to combine all the animation movements like from singleplayer?
Reply
#9

Use timers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)