Unfreezing after animation
#1

After I do some animation and use special action feature, and when I clear animation the player just stand in one place and can't move. It's not frozen really until i jump or press left mouse button for attack. Is there any way to clear player after he do similiar animations and special actions?


PHP код:
forward PickUpCrate(playerid);
public 
PickUpCrate(playerid)
{
    
ClearAnimations(playerid, 1);
    
SetPlayerAttachedObject(playerid, 0, 2358, 6, 0.064999, 0.093999, -0.159999, -107.099945, 0.899992, 76.699989, 1.000000, 1.000000, 1.000000);
    
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
    
ClearAnimations(playerid, 1);
    return 
1;
}
forward PutDownCrate(playerid);
public 
PutDownCrate(playerid)
{
    
ClearAnimations(playerid, 1);
    
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    
RemovePlayerAttachedObject(playerid, 0);
    
ClearAnimations(playerid, 1);
    return 
1;
} 
Somewhere up those timers are triggered with command, something like this:

Command for exampel /pickup:

PHP код:
{
        
ApplyAnimation(playerid, "CARRY", "liftup", 4.0, 0, 1, 0, 1, 1);
        
SetTimerEx("PickUpCrate", 1000, false, "i", playerid);
} 
Reply
#2

Try with this:
PHP код:
ApplyAnimation(playerid, "CARRY", "liftup", 4.0, 0, 1, 1, 0, 0); 
PHP код:
forward PickUpCrate(playerid); 
public 
PickUpCrate(playerid) 
{ 
    
ClearAnimations(playerid); 
    
SetPlayerAttachedObject(playerid, 0, 2358, 6, 0.064999, 0.093999, -0.159999, -107.099945, 0.899992, 76.699989, 1.000000, 1.000000, 1.000000); 
    
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
    return 
1; 
} 
forward PutDownCrate(playerid); 
public 
PutDownCrate(playerid) 
{ 
    
ClearAnimations(playerid); 
    
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); 
    
RemovePlayerAttachedObject(playerid, 0); 
    return 
1; 
} 
Reply
#3

Thank you very much, it works!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)