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



Unfreezing after animation - Saddin - 22.10.2017

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(playerid1);
    
SetPlayerAttachedObject(playerid0235860.0649990.093999, -0.159999, -107.0999450.89999276.6999891.0000001.0000001.000000);
    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_CARRY);
    
ClearAnimations(playerid1);
    return 
1;
}
forward PutDownCrate(playerid);
public 
PutDownCrate(playerid)
{
    
ClearAnimations(playerid1);
    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    
RemovePlayerAttachedObject(playerid0);
    
ClearAnimations(playerid1);
    return 
1;

Somewhere up those timers are triggered with command, something like this:

Command for exampel /pickup:

PHP код:
{
        
ApplyAnimation(playerid"CARRY""liftup"4.001011);
        
SetTimerEx("PickUpCrate"1000false"i"playerid);




Re: Unfreezing after animation - RIDE2DAY - 22.10.2017

Try with this:
PHP код:
ApplyAnimation(playerid"CARRY""liftup"4.001100); 
PHP код:
forward PickUpCrate(playerid); 
public 
PickUpCrate(playerid

    
ClearAnimations(playerid); 
    
SetPlayerAttachedObject(playerid0235860.0649990.093999, -0.159999, -107.0999450.89999276.6999891.0000001.0000001.000000); 
    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_CARRY);
    return 
1

forward PutDownCrate(playerid); 
public 
PutDownCrate(playerid

    
ClearAnimations(playerid); 
    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE); 
    
RemovePlayerAttachedObject(playerid0); 
    return 
1




Re: Unfreezing after animation - Saddin - 22.10.2017

Thank you very much, it works!