ApplyAnimation HELP
#1

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;
	}
Reply
#2

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);
}
Reply
#3

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.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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
Reply
#7

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
Reply
#8

use 4.1 for speed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)