Animation Clearing
#1

Hello.
I've been making a Death System recently and it should make you do a Animation to stay on the ground using this timer.

It's clearing the Animation after a few seconds and makes you stand up when you're supposed to stay on the ground until revived or the timer is gone.
pawn Код:
timer DeathFall[800](playerid)
{
    stop InjuredFall[playerid];
    TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid,"PED","KO_skid_front",4.0,0,1,1,1,0);
    return 1;
}
Of course i'm not going to paste the full coding of the Death System but at the Bottom i added.
pawn Код:
InjuredFall[playerid] = defer DeathFall(playerid);
You do the Animation, then somehow it clears the animation after the second
Reply
#2

Hello dannyk0ed,

I'm not a pro' at all but i'll try to help you at my best.

On your script, i can see:

pawn Код:
ApplyAnimation(playerid,"PED","KO_skid_front",4.0,0,1,1,1,0);
The official SAMP Wiki page says:

pawn Код:
ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync)

// time : Timer in milliseconds. For a never ending loop it should be 0.
With your script, the anim' would be played during 1 milisecond before stoping and i guess what you want is to keep it going until you call ClearAnimations() .

To do so, you must replace the 1 by a 0 to make the anim played in an infinite loop.
pawn Код:
ApplyAnimation(playerid, "PED", "KO_skid_front", 4.0, 0, 1, 1, 0, 0);
Hoping i helped you

PS: Sorry if my english isn't perfect but i'm french.
Reply
#3

pawn Код:
timer DeathFall[800](playerid)
{
    stop InjuredFall[playerid];
    TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid,"PED","KO_skid_front",4.0,0,1,1,1,0);
    ApplyAnimation(playerid,"PED","KO_skid_front",4.0,0,1,1,1,0);
    return 1;
}
Animations are synced at all, play them twice.
Reply
#4

Quote:
Originally Posted by jujuv
Посмотреть сообщение
Hello dannyk0ed,

I'm not a pro' at all but i'll try to help you at my best.

On your script, i can see:

pawn Код:
ApplyAnimation(playerid,"PED","KO_skid_front",4.0,0,1,1,1,0);
The official SAMP Wiki page says:

pawn Код:
ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync)

// time : Timer in milliseconds. For a never ending loop it should be 0.
With your script, the anim' would be played during 1 milisecond before stoping and i guess what you want is to keep it going until you call ClearAnimations() .

To do so, you must replace the 1 by a 0 to make the anim played in an infinite loop.
pawn Код:
ApplyAnimation(playerid, "PED", "KO_skid_front", 4.0, 0, 1, 1, 0, 0);
Hoping i helped you

PS: Sorry if my enlish isn't perfect but i'm french.
Silly me.

Thank you very much. It has worked.

[QUOTE=Strier;2567178]
pawn Код:
timer DeathFall[800](playerid)
{
    stop InjuredFall[playerid];
    TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid,"PED","KO_skid_front",4.0,0,1,1,1,0);
    ApplyAnimation(playerid,"PED","KO_skid_front",4.0,0,1,1,1,0);
    return 1;
}
Same for that. Thanks

I just stupidly copied the /lay Animination.
Reply
#5

You're welcome

If you're on a good day, don't hesitate to give me a reputaion point (^_^)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)