SA-MP Forums Archive
ApplyActorAnimation crashes my game - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ApplyActorAnimation crashes my game (/showthread.php?tid=660547)



ApplyActorAnimation crashes my game - Mike861 - 06.11.2018

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.



Re: ApplyActorAnimation crashes my game - TheToretto - 06.11.2018

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


Re: ApplyActorAnimation crashes my game - Mike861 - 06.11.2018

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");



Re: ApplyActorAnimation crashes my game - Calisthenics - 06.11.2018

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


Re: ApplyActorAnimation crashes my game - Mike861 - 06.11.2018

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);



Re: ApplyActorAnimation crashes my game - Calisthenics - 06.11.2018

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.


Re: ApplyActorAnimation crashes my game - TheToretto - 06.11.2018

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);
}



Re: ApplyActorAnimation crashes my game - Mike861 - 06.11.2018

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


Re: ApplyActorAnimation crashes my game - m4karow - 06.11.2018

Use timers