SA-MP Forums Archive
Animation doesn't stop after 25 seconds - 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 doesn't stop after 25 seconds (/showthread.php?tid=652007)



Animation doesn't stop after 25 seconds - IndependentGaming - 01.04.2018

Hello, I'm trying to add a walking animation on register it works like this:

Код:
ApplyAnimation(playerid, "PED", "WALK_gang2", 4.0, 1, 1, 1, 1, 25000, 1);
But then it just keeps walking.

if I changed it to:

Код:
ApplyAnimation(playerid, "PED", "WALK_gang2", 4.0, 0, 1, 1, 1, 25000, 1);
then it just freezes after 1 step:




Re: Animation doesn't stop after 25 seconds - Mugala - 01.04.2018

well, I'll create a code in a shortly.


Re: Animation doesn't stop after 25 seconds - Mugala - 01.04.2018

use ApplyAnimationEx, instead of ApplyAnimation.
PHP код:
stock ApplyAnimationEx(playeridanimlib[], animname[], Float:fDeltalooplockxlockyfreezetimeforcesync)
{
    
ApplyAnimation(playeridanimlibanimnamefDeltalooplockxlockyfreezetimeforcesync);
    
SetTimerEx("ClearAnims",time,0,"i",playerid);
}

forward ClearAnims(playerid);
public 
ClearAnims(playerid)
{
    
ClearAnimations(playerid);
    return 
1;




Re: Animation doesn't stop after 25 seconds - IndependentGaming - 01.04.2018

Quote:
Originally Posted by Mugala
Посмотреть сообщение
use ApplyAnimationEx, instead of ApplyAnimation.
PHP код:
stock ApplyAnimationEx(playeridanimlib[], animname[], Float:fDeltalooplockxlockyfreezetimeforcesync)
{
    
ApplyAnimation(playeridanimlibanimnamefDeltalooplockxlockyfreezetimeforcesync);
    
SetTimerEx("ClearAnims",time,0,"i",playerid);
}
forward ClearAnims(playerid);
public 
ClearAnims(playerid)
{
    
ClearAnimations(playerid);
    return 
1;

Thankyou, so now I to this:

PHP код:
ApplyAnimation(playerid"PED""WALK_gang2"4.0111111);
SetTimerEx("ClearAnims",25000,0,"i",playerid); 
?


Re: Animation doesn't stop after 25 seconds - Mugala - 01.04.2018

no, only use ApplyAnimationEx, these 2 code will be called automatically.


Re: Animation doesn't stop after 25 seconds - IndependentGaming - 01.04.2018

Quote:
Originally Posted by Mugala
Посмотреть сообщение
no, only use ApplyAnimationEx, these 2 code will be called automatically.
Can you make a example maybe ?

how do I apply "PED", "WALK_gang2" to ApplyAnimationEx ?


Re: Animation doesn't stop after 25 seconds - Mugala - 01.04.2018

ApplyAnimationEx(playerid, "PED", "WALK_gang2", 4.0, 0, 1, 1, 1, 25000, 1);