SA-MP Forums Archive
ApplyAnimation HELP - 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: ApplyAnimation HELP (/showthread.php?tid=583104)



ApplyAnimation HELP - TheSkyBlueTeam - 25.07.2015

Hey, for some reason I gotta type /sit twice for the animation to be applied. What's wrong?

Код:
	if(!strcmp(cmdtext, "/sit", true))
	{
  		ApplyAnimation(playerid, "BEACH", "PARKSIT_M_LOOP", 4.0, 1, 0, 0, 0, 0); 
		return 1;
	}



Re: ApplyAnimation HELP - TwinkiDaBoss - 25.07.2015

Add this under OnPlayerConnect
pawn Код:
PreloadAnimLib(playerid,"BEACH");
and also somewhere in any part of your script
pawn Код:
PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}



Re: ApplyAnimation HELP - Abagail - 25.07.2015

SEARCH THE FORUMS BEFORE YOU ASK

This question has been asked more than 100 times, use the search function before asking a question in the future. You need to preload the animation for the player. This includes actor and NPC animations, the client seeing the animation needs to have it streamed / preloaded to see the animation.

Apply the animation atleast once before showing it to the player.


Re: ApplyAnimation HELP - TheSkyBlueTeam - 25.07.2015

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
Add this under OnPlayerConnect
pawn Код:
PreloadAnimLib(playerid,"BEACH");
and also somewhere in any part of your script
pawn Код:
PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
Hey, I tried that, but I still gotta type it twice for it to load.


Re: ApplyAnimation HELP - TwinkiDaBoss - 25.07.2015

Use
pawn Код:
ApplyAnimation(playerid, "BEACH", "PARKSIT_M_LOOP", 4.0, 1, 0, 0, 0, 0);
once somewhere in the script, like before that command, you gotta load it that way too.


Re: ApplyAnimation HELP - TheSkyBlueTeam - 25.07.2015

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
Use
pawn Код:
ApplyAnimation(playerid, "BEACH", "PARKSIT_M_LOOP", 4.0, 1, 0, 0, 0, 0);
once somewhere in the script, like before that command, you gotta load it that way too.
Now it worked, thanks! +rep


Re: ApplyAnimation HELP - TheSkyBlueTeam - 25.07.2015

Quote:
Originally Posted by Abagail
Посмотреть сообщение
SEARCH THE FORUMS BEFORE YOU ASK

This question has been asked more than 100 times, use the search function before asking a question in the future. You need to preload the animation for the player. This includes actor and NPC animations, the client seeing the animation needs to have it streamed / preloaded to see the animation.

Apply the animation atleast once before showing it to the player.
Hey, I added this under OnPlayerSpawn:
ApplyAnimation(playerid, "BEACH", "PARKSIT_M_LOOP", 4.0, 1, 0, 0, 0, 0);

Now it works. I will do some more re-search next time, thanks!

+rep


Re: ApplyAnimation HELP - Tamer - 26.07.2015

use 4.1 for speed