Animation doesn't work on spawn
#1

Hello, I try to let the player move with a animation for 7 seconds on register spawn here is the code:

Nothing happens player doesn't move.

PHP код:
TogglePlayerSpectating(playeridfalse);
            
SetPlayerPos(playerid4602.7427190.89279.3325);
            
SetPlayerFacingAngle(playerid22.1796);
            
ApplyAnimation(playerid"PED""WALK_gang2"4.0011071);
            
SetPlayerSkin(playeridPlayerInfo[playerid][pModel]);
            
SetPlayerInterior(playerid0);
            
SetPlayerVirtualWorld(playerid0);
            
SetHealth(playerid100);
            
PlayerInfo[playerid][pLevel]= 5;
            
ClearChatbox(playerid); 
Reply
#2

Anyone ?
Reply
#3

I manged to stream the objects but for some reason the animation doesn't work I really have no idea why

PHP код:
TogglePlayerSpectating(playeridfalse);
            
SetPlayerPos(playerid4602.7427190.89279.3325);
            
Player_StreamPrep(playerid4602.7427190.89279.3325FREEZE_TIME);
            
SetPlayerFacingAngle(playerid22.1796);
            
ApplyAnimation(playerid"PED""WALK_gang2"4.0111111);
            
SetPlayerSkin(playeridPlayerInfo[playerid][pModel]);
            
SetPlayerInterior(playerid0);
            
SetPlayerVirtualWorld(playerid0);
            
SetHealth(playerid100);
            
PlayerInfo[playerid][pConnectHours] = 30;
            
ClearChatbox(playerid); 
Reply
#4

If you didn't tried then apply animations twice.
Reply
#5

Quote:
Originally Posted by YenTy
Посмотреть сообщение
If you didn't tried then apply animations twice.
Tried that as well still animation doesn't apply..
Reply
#6

Well I think I see it now, you're applying skin after apply an animations. It can cause a animations clearing. You've to set skin before any next animation step.
Reply
#7

Quote:
Originally Posted by YenTy
Посмотреть сообщение
Well I think I see it now, you're applying skin after apply an animations. It can cause a animations clearing. You've to set skin before any next animation step.
Placed it under the code and it still doesn't apply
Reply
#8

I've put your code under /test cmd and everything including changing skin after animations works fine. I find out that if position of character is too high or too low then after fall animation is not more used. Are cords good for sure?
Reply
#9

You can use Switch case

Код:
            TogglePlayerSpectating(playerid, false);
            SetPlayerPos(playerid, 4602.7427, 190.8927, 9.3325);
            Player_StreamPrep(playerid, 4602.7427, 190.8927, 9.3325, FREEZE_TIME);
            SetPlayerFacingAngle(playerid, 22.1796);
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0);
            SetHealth(playerid, 100);
            PlayerInfo[playerid][pConnectHours] = 30;
            ClearChatbox(playerid);  

	switch (classid)
	{

		case 0:
		{
		       //skin 270 with Dance Animation
			ApplyAnimation(playerid, "DANCING", "DNCE_M_A", 4.1, 1, 1, 1, 1, 1);
		}
                return 1;
       }
Set these according to your OnGamemodeInit Skins.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)