functioncall after finished animation
#1

hi all

i wanna know if there is a possibility to call a function after finishing animation. for sure i could manage it with a timer but that would be a nasty, difficult and very inaccurate sollution.

greetz
Reply
#2

Without a timer, no.

You could hook a timer to the 'time' parameter in ApplyAnimation, and have a function execute when the 'time' value reaches 0 though.

Something like this:

pawn Код:
ApplyAnimationWithTimer(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync, function[]) {
    ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync);
    SetTimer(function, time, false);
    return 1;
}
Reply
#3

quite ugly way - hope there will be some changes in next samp version. thanks calgon but what exactly is that "timer" parameter? "Timer in milliseconds. For a never ending loop it should be 0." doesnt say anything
Reply
#4

That explains everything... The amount of milliseconds the animation will execute for?
Reply
#5

fDelta is supposed to change that "fDelta - The speed to play the animation." - the highter fDelta is (loop = 0) the shorter the animationtime is isnt it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)