[Ajuda] Animaзгo
#1

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?
Reply
#2

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

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

switch(
AnimConnect[rand]) 
Reply
#3

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 
0ApplyAnimation(playerid"DANCING""bd_clap",4.0 ,1,0,0,0,-1,true);
        case 
1ApplyAnimation(playerid"DANCING""bd_clap1",4.0 ,1,0,0,0,-1,true);
          case 
2ApplyAnimation(playerid"DANCING""dance_loop",4.0 ,1,0,0,0,-1,true);
        case 
3ApplyAnimation(playerid"DANCING""DAN_Down_A",4.0 ,1,0,0,0,-1,true);
        case 
4ApplyAnimation(playerid"DANCING""DAN_Left_A",4.0 ,1,0,0,0,-1,true);
        case 
5ApplyAnimation(playerid"DANCING""DAN_Loop_A",4.0 ,1,0,0,0,-1,true);
        case 
6ApplyAnimation(playerid"DANCING""DAN_Right_A",4.0 ,1,0,0,0,-1,true);
        case 
7ApplyAnimation(playerid"DANCING""DAN_Up_A",4.0 ,1,0,0,0,-1,true);
        case 
8ApplyAnimation(playerid"DANCING""dnce_M_a",4.0 ,1,0,0,0,-1,true);
        case 
9ApplyAnimation(playerid"DANCING""dnce_M_b",4.0 ,1,0,0,0,-1,true);
        case 
10ApplyAnimation(playerid"DANCING""dnce_M_c",4.0 ,1,0,0,0,-1,true);
        case 
11ApplyAnimation(playerid"DANCING""dnce_M_d",4.0 ,1,0,0,0,-1,true);
        case 
12ApplyAnimation(playerid"DANCING""dnce_M_e",4.0 ,1,0,0,0,-1,true);
    } 
Reply
#4

Funcionou , obrigado SepZ e Cleyson
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)