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



animation - GeneralAref - 28.01.2016

i have this code but animation does not work in first time.

Код:
stock EnterRoLsBurgershot1(playerid){
    UnderRob[RoLsBurgershot1] = 1;
    SendClientMessage(playerid,COLOR_WHITE,"You're {f50000}stealing {FFFFFF}from {00FF22}LsBurgershot1.");
    SetPlayerPos(playerid,376.3532,-65.1812,1001.5078);
    SetPlayerFacingAngle(playerid,93.0549);
    ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",4.1,1,0,0,1,10,1);
	RobTimer[playerid][RoLsBurgershot1]=SetTimerEx("RoLsBurgershot1Timer",10000,false,"i",playerid);
	return 1;}
Код:
public RoLsBurgershot1Timer(playerid){
	UnderRob[RoLsBurgershot1] = 0;
	ClearAnimations(playerid);
	return 1;}
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
    if(newkeys & KEY_WALK){
    	if(IsPlayerInDynamicCP(playerid, CP[RoLsBurgershot1])){
    		if(UnderRob[RoLsBurgershot1] == 1)return SendClientMessage(playerid,COLOR_WHITE,"{FFFFFF}[{f50000}ERROR{FFFFFF}]This shop is {f50000}stolen.");
			EnterRoLsBurgershot1(playerid);
			return 1;}}
	return 1;}



Re: animation - Weponz - 28.01.2016

Preload animation libraries. Some require a second ApplyAnimation to work the first time.


Re: animation - GeneralAref - 28.01.2016

how?


Re: animation - Weponz - 28.01.2016

Add the following under OnPlayerSpawn:

pawn Код:
ApplyAnimation(playerid, "ROB_BANK", "null", 0, 0, 0, 0, 0, 1);
or simply call the function twice.


Re: animation - GeneralAref - 28.01.2016

and how to freeze player when use animation?camera can move.