[0.3b] Help! OnPlayerRequestClass animation isnt working
#1

Hey guys, Ok well OnPlayerRequestClass I have added the code
Код:
public OnPlayerRequestClass(playerid, classid)
{

	ApplyAnimation(playerid,"DEALER","DEALER_IDLE",4.1,0,0,0,0,0,1);

 	SetPlayerPos(playerid, 1877.7783, -1361.9614, 14.6406);
	SetPlayerFacingAngle(playerid, 179.8732);
	SetPlayerCameraPos(playerid, 1877.7006, -1367.4792, 14.6406);
	SetPlayerCameraLookAt(playerid, 1900.6584, -700.2100, 13.3000);


	//Picking what gang the player wishes to join.
	SetPlayerTeamFromClass(playerid, classid);
	return 1;
}
Everything works except for the animation, The players still just stand there motionless. Any ideas on how to fix this?
Reply
#2

Try looping the animation:
pawn Код:
ApplyAnimation(playerid,"DEALER","DEALER_IDLE",4.1,1,0,0,0,0,0);
Reply
#3

As far as i know, the animation doesnt executes right away by connecting for some reason,
it starts only after you swich between some classes. Im thinking of a timer will might solve this.

pawn Код:
forward classanim(playerid);
public classanim(playerid)
{
    ApplyAnimation(playerid,"DEALER","DEALER_IDLE",4.1,0,0,0,0,0,1);
    return 1;
}

public OnPlayerRequestClass(playerid)
{
    SetTimerEx("classanim", 2000, 0, "i", playerid);
    return 1;
}
EDIT: Duh, didnt worked aswell. Sorry out of ideas.
Reply
#4

Hey I just noticed your edit but just wanted to say it didnt work, but thank you for trying anyway
Reply
#5

Grim_ I tried looping the animation, no luck :/
Reply
#6

Are you sure the animation does something? "DEALER_IDLE" could mean just standing there in the 'dealer stance'.

Try it with other animations and see if they work, it could also be that animation not working correctly.
Reply
#7

I just got this to work, here's how I did it

Код:
forward classanim(playerid);
public classanim(playerid)
{
    ApplyAnimation(playerid,"STRIP","Strip_D",4.1,0,0,0,0,1);
    return 1;
    }
Then OnPlayerRequestClass
Код:
SetTimer("classanim",1000,0);
ApplyAnimation(playerid,"STRIP","strip_D",4,1,0,0,0,0,1);
I put it in middle of all my other variables in OnPlayerRequestClass but otherwise it would be
Код:
public OnPlayerRequestClass(playerid, classid);
{
        SetTimer("classanim",1000,0);
	ApplyAnimation(playerid,"STRIP","strip_D",4,1,0,0,0,0,1);
	return 1;
}
Hope it works buddy
Reply
#8

Preload the animation libraries
Reply
#9

Try on 0.3c? 0.3c has been released already.
Reply
#10

Quote:
Originally Posted by Hudgens
Посмотреть сообщение
I just got this to work, here's how I did it

Код:
forward classanim(playerid);
public classanim(playerid)
{
    ApplyAnimation(playerid,"STRIP","Strip_D",4.1,0,0,0,0,1);
    return 1;
    }
Then OnPlayerRequestClass
Код:
SetTimer("classanim",1000,0);
ApplyAnimation(playerid,"STRIP","strip_D",4,1,0,0,0,0,1);
I put it in middle of all my other variables in OnPlayerRequestClass but otherwise it would be
Код:
public OnPlayerRequestClass(playerid, classid);
{
        SetTimer("classanim",1000,0);
	ApplyAnimation(playerid,"STRIP","strip_D",4,1,0,0,0,0,1);
	return 1;
}
Hope it works buddy
Hey man, I tried the code out and it wasnt successful I began to think it was the animation I was trying so I tried your one "STRIP, STRIP_D" but still no luck, The players just stand there still. Thank you very much for trying to help out though buddy
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)