SA-MP Forums Archive
Animations one after the other !! Pls. help!! - 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: Animations one after the other !! Pls. help!! (/showthread.php?tid=327761)



Animations one after the other !! Pls. help!! - Bleach79 - 22.03.2012

I was making a command called dancing and i want 10 animations to be done one after the other. I had put a timer to do so. but only the first animation works.

pawn Код:
forward dance1(playerid);
forward dance2(playerid);
forward dance3(playerid);
forward dance4(playerid);
forward dance5(playerid);
forward dance6(playerid);
forward dance7(playerid);
forward dance8(playerid);
forward dance9(playerid);
forward dance10(playerid);
CMD:dance(playerid, params[])
{
#pragma unused params
ApplyAnimation( playerid, "DANCING" , "DANCE_LOOP" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
SetTimer("dance1", 5000, false);
SetTimer("dance2", 10000, false);
SetTimer("dance3", 15000, false);
SetTimer("dance4", 20000, false);
SetTimer("dance5", 25000, false);
SetTimer("dance6", 30000, false);
SetTimer("dance7", 35000, false);
SetTimer("dance8", 40000, false);
SetTimer("dance9", 45000, false);
SetTimer("dance10", 50000, false);
return 1;
}
public dance1(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DAN_DOWN_A" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance2(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DAN_LEFT_A" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance3(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DAN_LOOP_A" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance4(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DAN_RIGHT_A" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance5(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DAN_UP_A" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance6(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DNCE_M_A" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance7(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DNCE_M_B" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance8(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DNCE_M_C" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance9(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DNCE_M_D" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
public dance10(playerid)
{
ApplyAnimation( playerid, "DANCING" , "DNCE_M_E" , 2.0 , 0 , 1 , 1 , 0 , 5000 , 1);
}
help me to do itt


Re: Animations one after the other !! Pls. help!! - Bleach79 - 22.03.2012

no answers??


Re: Animations one after the other !! Pls. help!! - Bleach79 - 22.03.2012

somebody should help fast!!


Re: Animations one after the other !! Pls. help!! - iPLEOMAX - 22.03.2012

Use SetTimerEx and use the "ApplyAnimation" function twice or more. (Or Pre-load them?)

pawn Код:
SetTimerEx("dance1", 5000, false, "d", playerid);
SetTimerEx("dance2", 10000, false, "d", playerid);
SetTimerEx("dance3", 15000, false, "d", playerid);
SetTimerEx("dance4", 20000, false, "d", playerid);
SetTimerEx("dance5", 25000, false, "d", playerid);
SetTimerEx("dance6", 30000, false, "d", playerid);
SetTimerEx("dance7", 35000, false, "d", playerid);
SetTimerEx("dance8", 40000, false, "d", playerid);
SetTimerEx("dance9", 45000, false, "d", playerid);
SetTimerEx("dance10", 50000, false, "d", playerid);
And one more thing, you can really optimize this code. But nevermind, for now, you just need to fix it.