Wait for animation to complete before starting another - 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: Wait for animation to complete before starting another (
/showthread.php?tid=652894)
Wait for animation to complete before starting another -
andrikela - 21.04.2018
For example, I have this script:
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP)) {
ApplyAnimation(playerid, "PARACHUTE", "FALL_skyDive_DIE", 4.1, 0, 1, 1, 0, 790);
}
}
How can I force player to wait before animation plays fully and only then give him ability to re-play it?
(Something like animation anti-flood)
Re: Wait for animation to complete before starting another -
kovac - 21.04.2018
PHP код:
if(GetPlayerAnimationIndex(playerid) != 0) // ... player is using some animation
Re: Wait for animation to complete before starting another -
Dayrion - 21.04.2018
Quote:
Originally Posted by kovac
PHP код:
if(GetPlayerAnimationIndex(playerid) != 0) // ... player is using some animation
|
Every movement is an animation : standing, runing, walking, shooting. I guess when you are spectating, you don't have any animation.
Re: Wait for animation to complete before starting another -
andrikela - 21.04.2018
Dayrion is right, GetPlayerAnimationIndex returns 0 only if spectating/not spawned.
Re: Wait for animation to complete before starting another -
andrikela - 21.04.2018
I've found temporary solution - setting timer after every ApplyAnimation, but I still need another (more optimized and clean) way to do this.
Re: Wait for animation to complete before starting another -
andrikela - 25.05.2018
Sorry for bumping, but wanted you to know that SAMP is very raw and needs more work, but Kalcor doesn't give a shit about it. SAMP is dying, move to MTA.
Why the hell are animations synced by players and not controlled by server?