SA-MP Forums Archive
[Ajuda] Animaзгo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Animaзгo (/showthread.php?tid=587453)



Animaзгo - BartWhite - 30.08.2015

Eae galera, gostaria de colocar animaзхes randomicas pra quando o player vai escolher uma skin, eu procurei e nгo achei a respeito, sу vi um post mais ou menos relacionado e criei esse code:

Код:
new AnimConnect[MAX_PLAYERS];
     	switch(AnimConnect[playerid])
		{
		    case 0: ApplyAnimation(playerid, "DANCING", "bd_clap",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
		    case 1: ApplyAnimation(playerid, "DANCING", "bd_clap1",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
		    case 2: ApplyAnimation(playerid, "DANCING", "dance_loop",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
		    case 3: ApplyAnimation(playerid, "DANCING", "DAN_Down_A",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 4: ApplyAnimation(playerid, "DANCING", "DAN_Left_A",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 5: ApplyAnimation(playerid, "DANCING", "DAN_Loop_A",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 6: ApplyAnimation(playerid, "DANCING", "DAN_Right_A",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 7: ApplyAnimation(playerid, "DANCING", "DAN_Up_A",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 8: ApplyAnimation(playerid, "DANCING", "dnce_M_a",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 9: ApplyAnimation(playerid, "DANCING", "dnce_M_b",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 10: ApplyAnimation(playerid, "DANCING", "dnce_M_c",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 11: ApplyAnimation(playerid, "DANCING", "dnce_M_d",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] ++;
			case 12: ApplyAnimation(playerid, "DANCING", "dnce_M_e",4.0 ,1,0,0,0,-1,true), AnimConnect[playerid] = 0;
		}
Porem sу "usa" a primeira animaзгo, como eu posso resolver isso?


Re: Animaзгo - SepZ - 30.08.2015

vocк precisa criar o random.
https://sampwiki.blast.hk/wiki/Random

PHP код:
new rand = random(13);

switch(
AnimConnect[rand]) 



Re: Animaзгo - Cleyson - 30.08.2015

Ao criar a variбvel AnimConnect ela assume o valor 0, por isso sу funcionara o primeiro.

Usa uma random, assim:

PHP код:
    new iRand = random(13);
    switch(
iRand)
    {
        case 
0: ApplyAnimation(playerid, "DANCING", "bd_clap",4.0 ,1,0,0,0,-1,true);
        case 
1: ApplyAnimation(playerid, "DANCING", "bd_clap1",4.0 ,1,0,0,0,-1,true);
          case 
2: ApplyAnimation(playerid, "DANCING", "dance_loop",4.0 ,1,0,0,0,-1,true);
        case 
3: ApplyAnimation(playerid, "DANCING", "DAN_Down_A",4.0 ,1,0,0,0,-1,true);
        case 
4: ApplyAnimation(playerid, "DANCING", "DAN_Left_A",4.0 ,1,0,0,0,-1,true);
        case 
5: ApplyAnimation(playerid, "DANCING", "DAN_Loop_A",4.0 ,1,0,0,0,-1,true);
        case 
6: ApplyAnimation(playerid, "DANCING", "DAN_Right_A",4.0 ,1,0,0,0,-1,true);
        case 
7: ApplyAnimation(playerid, "DANCING", "DAN_Up_A",4.0 ,1,0,0,0,-1,true);
        case 
8: ApplyAnimation(playerid, "DANCING", "dnce_M_a",4.0 ,1,0,0,0,-1,true);
        case 
9: ApplyAnimation(playerid, "DANCING", "dnce_M_b",4.0 ,1,0,0,0,-1,true);
        case 
10: ApplyAnimation(playerid, "DANCING", "dnce_M_c",4.0 ,1,0,0,0,-1,true);
        case 
11: ApplyAnimation(playerid, "DANCING", "dnce_M_d",4.0 ,1,0,0,0,-1,true);
        case 
12: ApplyAnimation(playerid, "DANCING", "dnce_M_e",4.0 ,1,0,0,0,-1,true);
    } 



Re: Animaзгo - BartWhite - 30.08.2015

Funcionou , obrigado SepZ e Cleyson