SA-MP Forums Archive
[Ajuda] Loop em uma callbak - 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] Loop em uma callbak (/showthread.php?tid=455429)



Loop em uma callbak - minimessi10 - 01.08.2013

Pessoas estou precisando de uma ajudinha estou precisando criar um loop nessa callbak eu estava criando essas profissoes porem as cores nгo estavгo certas ficavгo aleatorias mas consegui arrumar porem so pega para o ID 0 e me falarгo para mim criar um loop mas nгo sei muinto bem usar um loop e preciso de uma ajudinha ok.

pawn Код:
public OnPlayerSelectPos(playerid)
{
    if(Profissao[playerid] == 0)
    {
        SetPlayerColor(playerid, COR_DESEMPREGADO);
    }
    else if(Profissao[playerid] == 1)
    {
        SetPlayerColor(playerid, COR_ADVOGADO);
    }
    else if(Profissao[playerid] == 2)
    {
        SetPlayerColor(playerid, COR_ALPINISTA);
    }
    else if(Profissao[playerid] == 3)
    {
        SetPlayerColor(playerid, COR_ASTRONOMO);
    }
    else if(Profissao[playerid] == 4)
    {
        SetPlayerColor(playerid, COR_APOSENTADO);
    }
    else if(Profissao[playerid] == 5)
    {
        SetPlayerColor(playerid, COR_BAILARINA);
    }
    else if(Profissao[playerid] == 6)
    {
        SetPlayerColor(playerid, COR_BANCARIO);
    }
    else if(Profissao[playerid] == 7)
    {
        SetPlayerColor(playerid, COR_BARMAN);
    }
    else if(Profissao[playerid] == 8)
    {
        SetPlayerColor(playerid, COR_CAMINHONEIRO);
    }
    else if(Profissao[playerid] == 9)
    {
        SetPlayerColor(playerid, COR_CACADOR);
    }
    else if(Profissao[playerid] == 10)
    {
        SetPlayerColor(playerid, COR_CHAVEIRO);
    }
    else if(Profissao[playerid] == 11)
    {
        SetPlayerColor(playerid, COR_CIENTISTA);
    }
    else if(Profissao[playerid] == 12)
    {
        SetPlayerColor(playerid, COR_DEPUTADO);
    }
    else if(Profissao[playerid] == 13)
    {
        SetPlayerColor(playerid, COR_DETETIVE);
    }
    else if(Profissao[playerid] == 14)
    {
        SetPlayerColor(playerid, COR_ENTREGADOR_DE_PIZZA);
    }
    else if(Profissao[playerid] == 15)
    {
        SetPlayerColor(playerid, COR_FARMACEUTICO);
    }
    else if(Profissao[playerid] == 16)
    {
        SetPlayerColor(playerid, COR_FRENTISTA);
    }
    else if(Profissao[playerid] == 17)
    {
        SetPlayerColor(playerid, COR_GARI);
    }
    else if(Profissao[playerid] == 18)
    {
        SetPlayerColor(playerid, COR_GOVERNADOR);
    }
    else if(Profissao[playerid] == 19)
    {
        SetPlayerColor(playerid, COR_GUARDA_COSTAS);
    }
    else if(Profissao[playerid] == 20)
    {
        SetPlayerColor(playerid, COR_INSTRUTOR);
    }
    else if(Profissao[playerid] == 21)
    {
        SetPlayerColor(playerid, COR_JORNALISTA);
    }
    else if(Profissao[playerid] == 22)
    {
        SetPlayerColor(playerid, COR_JUIZ);
    }
    else if(Profissao[playerid] == 23)
    {
        SetPlayerColor(playerid, COR_MATEMATICO);
    }
    else if(Profissao[playerid] == 23)
    {
        SetPlayerColor(playerid, COR_MECANICO);
    }
    else if(Profissao[playerid] == 24)
    {
        SetPlayerColor(playerid, COR_MINERADOR);
    }
    else if(Profissao[playerid] == 25)
    {
        SetPlayerColor(playerid, COR_MOTORISTAP);
    }
    else if(Profissao[playerid] == 26)
    {
        SetPlayerColor(playerid, COR_PARAMEDICO);
    }
    else if(Profissao[playerid] == 27)
    {
        SetPlayerColor(playerid, COR_PESCADOR);
    }
    else if(Profissao[playerid] == 28)
    {
        SetPlayerColor(playerid, COR_PETROLEIRO);
    }
    else if(Profissao[playerid] == 29)
    {
        SetPlayerColor(playerid, COR_PILOTO_DE_CORRIDA);
    }
    else if(Profissao[playerid] == 30)
    {
        SetPlayerColor(playerid, COR_PREFEITO);
    }
    else if(Profissao[playerid] == 31)
    {
        SetPlayerColor(playerid, COR_PROMOTER);
    }
    else if(Profissao[playerid] == 32)
    {
        SetPlayerColor(playerid, COR_RAPPER);
    }
    else if(Profissao[playerid] == 33)
    {
        SetPlayerColor(playerid, COR_RAPPER);
    }
    else if(Profissao[playerid] == 34)
    {
        SetPlayerColor(playerid, COR_TECNICO_DE_INFORMATICA);
    }
    else if(Profissao[playerid] == 35)
    {
        SetPlayerColor(playerid, COR_VENDEDOR_DE_CARROS);
    }
    else if(Profissao[playerid] == 36)
    {
        SetPlayerColor(playerid, COR_VENDEDOR_DE_ROUPAS);
    }
    else if(Profissao[playerid] == 37)
    {
        SetPlayerColor(playerid, COR_VIGIA);
    }
    else if(Profissao[playerid] == 38)
    {
        SetPlayerColor(playerid, COR_BOMBEIRO);
    }
    else if(Profissao[playerid] == 39)
    {
        SetPlayerColor(playerid, COR_CIA);
    }
    else if(Profissao[playerid] == 40)
    {
        SetPlayerColor(playerid, COR_ESQUADRAO_ANTI_BOMBAS);
    }
    else if(Profissao[playerid] == 41)
    {
        SetPlayerColor(playerid, COR_FBI);
    }
    else if(Profissao[playerid] == 42)
    {
        SetPlayerColor(playerid, COR_IBAMA);
    }
    else if(Profissao[playerid] == 43)
    {
        SetPlayerColor(playerid, COR_INTERPOL);
    }
    else if(Profissao[playerid] == 44)
    {
        SetPlayerColor(playerid, COR_NARCOTICOS);
    }
    else if(Profissao[playerid] == 45)
    {
        SetPlayerColor(playerid, COR_POLICIA_CIVIL);
    }
    else if(Profissao[playerid] == 46)
    {
        SetPlayerColor(playerid, COR_POLICIA_FEDERAL);
    }
    else if(Profissao[playerid] == 47)
    {
        SetPlayerColor(playerid, COR_POLICIA_FLORESTAL);
    }
    else if(Profissao[playerid] == 48)
    {
        SetPlayerColor(playerid, COR_POLICIA_RODOVIARIA);
    }
    else if(Profissao[playerid] == 49)
    {
        SetPlayerColor(playerid, COR_SWAT);
    }
    else if(Profissao[playerid] == 50)
    {
        SetPlayerColor(playerid, COR_ASSASSINO);
    }
    else if(Profissao[playerid] == 51)
    {
        SetPlayerColor(playerid, COR_ASSALTANTE);
    }
    else if(Profissao[playerid] == 52)
    {
        SetPlayerColor(playerid, COR_CAFETAO);
    }
    else if(Profissao[playerid] == 53)
    {
        SetPlayerColor(playerid, COR_CHEFE_DA_MAFIA);
    }
    else if(Profissao[playerid] == 54)
    {
        SetPlayerColor(playerid, COR_MATADOR_DE_ALUGUEL);
    }
    else if(Profissao[playerid] == 55)
    {
        SetPlayerColor(playerid, COR_PROSTITUTA);
    }
    else if(Profissao[playerid] == 56)
    {
        SetPlayerColor(playerid, COR_TERRORISTA);
    }
    else if(Profissao[playerid] == 57)
    {
        SetPlayerColor(playerid, COR_TRAFICANTE);
    }
    else if(Profissao[playerid] == 58)
    {
        SetPlayerColor(playerid, COR_VENDEDOR_DE_ARMAS);
    }
    else if(Profissao[playerid] == 59)
    {
        SetPlayerColor(playerid, COR_MAQUINISTA);
    }
    else if(Profissao[playerid] == 60)
    {
        SetPlayerColor(playerid, COR_MOTO_TAXI);
    }
    else if(Profissao[playerid] == 61)
    {
        SetPlayerColor(playerid, COR_MOTORISTA_DE_ONIBUS);
    }
    else if(Profissao[playerid] == 62)
    {
        SetPlayerColor(playerid, COR_PILOTO_DE_AVIAO);
    }
    else if(Profissao[playerid] == 63)
    {
        SetPlayerColor(playerid, COR_TAXISTA);
    }
    else if(Profissao[playerid] == 64)
    {
        SetPlayerColor(playerid, COR_FORЗA_AEREA);
    }
    else if(Profissao[playerid] == 65)
    {
        SetPlayerColor(playerid, COR_MARINHA);
    }
    else if(Profissao[playerid] == 66)
    {
        SetPlayerColor(playerid, COR_TERRESTRE);
    }
    else if(Profissao[playerid] == 67)
    {
        SetPlayerColor(playerid, COR_BISPO);
    }
    else if(Profissao[playerid] == 68)
    {
        SetPlayerColor(playerid, COR_JOGADOR_DE_FUTEBOL);
    }
    else if(Profissao[playerid] == 69)
    {
        SetPlayerColor(playerid, COR_PADRE);
    }
    else if(Profissao[playerid] == 70)
    {
        SetPlayerColor(playerid, COR_CARREGADOR);
    }
    else if(Profissao[playerid] == 71)
    {
        SetPlayerColor(playerid, COR_PORTEIRO_DO_CONDOMINIO);
    }
    else if(Profissao[playerid] == 72)
    {
        SetPlayerColor(playerid, COR_PORTEIRO_DA_VILA);
    }
    else if(Profissao[playerid] == 73)
    {
        SetPlayerColor(playerid, COR_SVILA);
    }
    else if(Profissao[playerid] == 74)
    {
        SetPlayerColor(playerid, COR_SCONDOMINIO);
    }
    else if(Profissao[playerid] == 75)
    {
        SetPlayerColor(playerid, COR_SCASSINO);
    }
    else if(Profissao[playerid] == 76)
    {
        SetPlayerColor(playerid, COR_SDETRAN);
    }
    return 1;
}
Peguei esse code do ExTRanyMoney do topico que ele crio !


Re: Loop em uma callbak - ProKillerpa - 01.08.2013

PHP код:
for(new L=0MAX_PLAYERSL++)
{
// Codigo!




Re: Loop em uma callbak - minimessi10 - 01.08.2013

Deu esses warnings

pawn Код:
C:\Users\Marcelo\Documents\Servers\samp03x_svr_R1-2_win32\gamemodes\GM.pwn(6567) : warning 206: redundant test: constant expression is non-zero
C:\Users\Marcelo\Documents\Servers\samp03x_svr_R1-2_win32\gamemodes\GM.pwn(6883) : warning 209: function "OnPlayerSelectPos" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
pawn Код:
for(new L=0; MAX_PLAYERS; L++)
pawn Код:
}



Re: Loop em uma callbak - DannielCooper - 01.08.2013

Manda o code todo mano, que eu te ajudo .


Re: Loop em uma callbak - minimessi10 - 01.08.2013

pawn Код:
public OnPlayerSelectPos(playerid)
{
for(new L=0; MAX_PLAYERS; L++)
{
    if(Profissao[playerid] == 0)
    {
        SetPlayerColor(playerid, COR_DESEMPREGADO);
    }
    else if(Profissao[playerid] == 1)
    {
        SetPlayerColor(playerid, COR_ADVOGADO);
    }
    else if(Profissao[playerid] == 2)
    {
        SetPlayerColor(playerid, COR_ALPINISTA);
    }
    else if(Profissao[playerid] == 3)
    {
        SetPlayerColor(playerid, COR_ASTRONOMO);
    }
    else if(Profissao[playerid] == 4)
    {
        SetPlayerColor(playerid, COR_APOSENTADO);
    }
    else if(Profissao[playerid] == 5)
    {
        SetPlayerColor(playerid, COR_BAILARINA);
    }
    else if(Profissao[playerid] == 6)
    {
        SetPlayerColor(playerid, COR_BANCARIO);
    }
    else if(Profissao[playerid] == 7)
    {
        SetPlayerColor(playerid, COR_BARMAN);
    }
    else if(Profissao[playerid] == 8)
    {
        SetPlayerColor(playerid, COR_CAMINHONEIRO);
    }
    else if(Profissao[playerid] == 9)
    {
        SetPlayerColor(playerid, COR_CACADOR);
    }
    else if(Profissao[playerid] == 10)
    {
        SetPlayerColor(playerid, COR_CHAVEIRO);
    }
    else if(Profissao[playerid] == 11)
    {
        SetPlayerColor(playerid, COR_CIENTISTA);
    }
    else if(Profissao[playerid] == 12)
    {
        SetPlayerColor(playerid, COR_DEPUTADO);
    }
    else if(Profissao[playerid] == 13)
    {
        SetPlayerColor(playerid, COR_DETETIVE);
    }
    else if(Profissao[playerid] == 14)
    {
        SetPlayerColor(playerid, COR_ENTREGADOR_DE_PIZZA);
    }
    else if(Profissao[playerid] == 15)
    {
        SetPlayerColor(playerid, COR_FARMACEUTICO);
    }
    else if(Profissao[playerid] == 16)
    {
        SetPlayerColor(playerid, COR_FRENTISTA);
    }
    else if(Profissao[playerid] == 17)
    {
        SetPlayerColor(playerid, COR_GARI);
    }
    else if(Profissao[playerid] == 18)
    {
        SetPlayerColor(playerid, COR_GOVERNADOR);
    }
    else if(Profissao[playerid] == 19)
    {
        SetPlayerColor(playerid, COR_GUARDA_COSTAS);
    }
    else if(Profissao[playerid] == 20)
    {
        SetPlayerColor(playerid, COR_INSTRUTOR);
    }
    else if(Profissao[playerid] == 21)
    {
        SetPlayerColor(playerid, COR_JORNALISTA);
    }
    else if(Profissao[playerid] == 22)
    {
        SetPlayerColor(playerid, COR_JUIZ);
    }
    else if(Profissao[playerid] == 23)
    {
        SetPlayerColor(playerid, COR_MATEMATICO);
    }
    else if(Profissao[playerid] == 23)
    {
        SetPlayerColor(playerid, COR_MECANICO);
    }
    else if(Profissao[playerid] == 24)
    {
        SetPlayerColor(playerid, COR_MINERADOR);
    }
    else if(Profissao[playerid] == 25)
    {
        SetPlayerColor(playerid, COR_MOTORISTAP);
    }
    else if(Profissao[playerid] == 26)
    {
        SetPlayerColor(playerid, COR_PARAMEDICO);
    }
    else if(Profissao[playerid] == 27)
    {
        SetPlayerColor(playerid, COR_PESCADOR);
    }
    else if(Profissao[playerid] == 28)
    {
        SetPlayerColor(playerid, COR_PETROLEIRO);
    }
    else if(Profissao[playerid] == 29)
    {
        SetPlayerColor(playerid, COR_PILOTO_DE_CORRIDA);
    }
    else if(Profissao[playerid] == 30)
    {
        SetPlayerColor(playerid, COR_PREFEITO);
    }
    else if(Profissao[playerid] == 31)
    {
        SetPlayerColor(playerid, COR_PROMOTER);
    }
    else if(Profissao[playerid] == 32)
    {
        SetPlayerColor(playerid, COR_RAPPER);
    }
    else if(Profissao[playerid] == 33)
    {
        SetPlayerColor(playerid, COR_RAPPER);
    }
    else if(Profissao[playerid] == 34)
    {
        SetPlayerColor(playerid, COR_TECNICO_DE_INFORMATICA);
    }
    else if(Profissao[playerid] == 35)
    {
        SetPlayerColor(playerid, COR_VENDEDOR_DE_CARROS);
    }
    else if(Profissao[playerid] == 36)
    {
        SetPlayerColor(playerid, COR_VENDEDOR_DE_ROUPAS);
    }
    else if(Profissao[playerid] == 37)
    {
        SetPlayerColor(playerid, COR_VIGIA);
    }
    else if(Profissao[playerid] == 38)
    {
        SetPlayerColor(playerid, COR_BOMBEIRO);
    }
    else if(Profissao[playerid] == 39)
    {
        SetPlayerColor(playerid, COR_CIA);
    }
    else if(Profissao[playerid] == 40)
    {
        SetPlayerColor(playerid, COR_ESQUADRAO_ANTI_BOMBAS);
    }
    else if(Profissao[playerid] == 41)
    {
        SetPlayerColor(playerid, COR_FBI);
    }
    else if(Profissao[playerid] == 42)
    {
        SetPlayerColor(playerid, COR_IBAMA);
    }
    else if(Profissao[playerid] == 43)
    {
        SetPlayerColor(playerid, COR_INTERPOL);
    }
    else if(Profissao[playerid] == 44)
    {
        SetPlayerColor(playerid, COR_NARCOTICOS);
    }
    else if(Profissao[playerid] == 45)
    {
        SetPlayerColor(playerid, COR_POLICIA_CIVIL);
    }
    else if(Profissao[playerid] == 46)
    {
        SetPlayerColor(playerid, COR_POLICIA_FEDERAL);
    }
    else if(Profissao[playerid] == 47)
    {
        SetPlayerColor(playerid, COR_POLICIA_FLORESTAL);
    }
    else if(Profissao[playerid] == 48)
    {
        SetPlayerColor(playerid, COR_POLICIA_RODOVIARIA);
    }
    else if(Profissao[playerid] == 49)
    {
        SetPlayerColor(playerid, COR_SWAT);
    }
    else if(Profissao[playerid] == 50)
    {
        SetPlayerColor(playerid, COR_ASSASSINO);
    }
    else if(Profissao[playerid] == 51)
    {
        SetPlayerColor(playerid, COR_ASSALTANTE);
    }
    else if(Profissao[playerid] == 52)
    {
        SetPlayerColor(playerid, COR_CAFETAO);
    }
    else if(Profissao[playerid] == 53)
    {
        SetPlayerColor(playerid, COR_CHEFE_DA_MAFIA);
    }
    else if(Profissao[playerid] == 54)
    {
        SetPlayerColor(playerid, COR_MATADOR_DE_ALUGUEL);
    }
    else if(Profissao[playerid] == 55)
    {
        SetPlayerColor(playerid, COR_PROSTITUTA);
    }
    else if(Profissao[playerid] == 56)
    {
        SetPlayerColor(playerid, COR_TERRORISTA);
    }
    else if(Profissao[playerid] == 57)
    {
        SetPlayerColor(playerid, COR_TRAFICANTE);
    }
    else if(Profissao[playerid] == 58)
    {
        SetPlayerColor(playerid, COR_VENDEDOR_DE_ARMAS);
    }
    else if(Profissao[playerid] == 59)
    {
        SetPlayerColor(playerid, COR_MAQUINISTA);
    }
    else if(Profissao[playerid] == 60)
    {
        SetPlayerColor(playerid, COR_MOTO_TAXI);
    }
    else if(Profissao[playerid] == 61)
    {
        SetPlayerColor(playerid, COR_MOTORISTA_DE_ONIBUS);
    }
    else if(Profissao[playerid] == 62)
    {
        SetPlayerColor(playerid, COR_PILOTO_DE_AVIAO);
    }
    else if(Profissao[playerid] == 63)
    {
        SetPlayerColor(playerid, COR_TAXISTA);
    }
    else if(Profissao[playerid] == 64)
    {
        SetPlayerColor(playerid, COR_FORЗA_AEREA);
    }
    else if(Profissao[playerid] == 65)
    {
        SetPlayerColor(playerid, COR_MARINHA);
    }
    else if(Profissao[playerid] == 66)
    {
        SetPlayerColor(playerid, COR_TERRESTRE);
    }
    else if(Profissao[playerid] == 67)
    {
        SetPlayerColor(playerid, COR_BISPO);
    }
    else if(Profissao[playerid] == 68)
    {
        SetPlayerColor(playerid, COR_JOGADOR_DE_FUTEBOL);
    }
    else if(Profissao[playerid] == 69)
    {
        SetPlayerColor(playerid, COR_PADRE);
    }
    else if(Profissao[playerid] == 70)
    {
        SetPlayerColor(playerid, COR_CARREGADOR);
    }
    else if(Profissao[playerid] == 71)
    {
        SetPlayerColor(playerid, COR_PORTEIRO_DO_CONDOMINIO);
    }
    else if(Profissao[playerid] == 72)
    {
        SetPlayerColor(playerid, COR_PORTEIRO_DA_VILA);
    }
    else if(Profissao[playerid] == 73)
    {
        SetPlayerColor(playerid, COR_SVILA);
    }
    else if(Profissao[playerid] == 74)
    {
        SetPlayerColor(playerid, COR_SCONDOMINIO);
    }
    else if(Profissao[playerid] == 75)
    {
        SetPlayerColor(playerid, COR_SCASSINO);
    }
    else if(Profissao[playerid] == 76)
    {
        SetPlayerColor(playerid, COR_SDETRAN);
    }
    return 1;
}
}



Re: Loop em uma callbak - ProKillerpa - 01.08.2013

PHP код:
public OnPlayerSelectPos(L)
{
for(new 
L=0MAX_PLAYERSL++)
{
    if(
Profissao[L] == 0)
    {
        
SetPlayerColor(LCOR_DESEMPREGADO);
    }
    else if(
Profissao[L] == 1)
    {
        
SetPlayerColor(LCOR_ADVOGADO);
    }
    else if(
Profissao[L] == 2)
    {
        
SetPlayerColor(LCOR_ALPINISTA);
    }
    else if(
Profissao[L] == 3)
    {
        
SetPlayerColor(LCOR_ASTRONOMO);
    }
    else if(
Profissao[L] == 4)
    {
        
SetPlayerColor(LCOR_APOSENTADO);
    }
    else if(
Profissao[L] == 5)
    {
        
SetPlayerColor(LCOR_BAILARINA);
    }
    else if(
Profissao[L] == 6)
    {
        
SetPlayerColor(LCOR_BANCARIO);
    }
    else if(
Profissao[L] == 7)
    {
        
SetPlayerColor(LCOR_BARMAN);
    }
    else if(
Profissao[L] == 8)
    {
        
SetPlayerColor(LCOR_CAMINHONEIRO);
    }
    else if(
Profissao[L] == 9)
    {
        
SetPlayerColor(LCOR_CACADOR);
    }
    else if(
Profissao[L] == 10)
    {
        
SetPlayerColor(LCOR_CHAVEIRO);
    }
    else if(
Profissao[L] == 11)
    {
        
SetPlayerColor(LCOR_CIENTISTA);
    }
    else if(
Profissao[L] == 12)
    {
        
SetPlayerColor(LCOR_DEPUTADO);
    }
    else if(
Profissao[L] == 13)
    {
        
SetPlayerColor(LCOR_DETETIVE);
    }
    else if(
Profissao[L] == 14)
    {
        
SetPlayerColor(LCOR_ENTREGADOR_DE_PIZZA);
    }
    else if(
Profissao[L] == 15)
    {
        
SetPlayerColor(LCOR_FARMACEUTICO);
    }
    else if(
Profissao[L] == 16)
    {
        
SetPlayerColor(LCOR_FRENTISTA);
    }
    else if(
Profissao[L] == 17)
    {
        
SetPlayerColor(LCOR_GARI);
    }
    else if(
Profissao[L] == 18)
    {
        
SetPlayerColor(LCOR_GOVERNADOR);
    }
    else if(
Profissao[L] == 19)
    {
        
SetPlayerColor(LCOR_GUARDA_COSTAS);
    }
    else if(
Profissao[L] == 20)
    {
        
SetPlayerColor(LCOR_INSTRUTOR);
    }
    else if(
Profissao[L] == 21)
    {
        
SetPlayerColor(LCOR_JORNALISTA);
    }
    else if(
Profissao[L] == 22)
    {
        
SetPlayerColor(LCOR_JUIZ);
    }
    else if(
Profissao[L] == 23)
    {
        
SetPlayerColor(LCOR_MATEMATICO);
    }
    else if(
Profissao[L] == 23)
    {
        
SetPlayerColor(LCOR_MECANICO);
    }
    else if(
Profissao[L] == 24)
    {
        
SetPlayerColor(LCOR_MINERADOR);
    }
    else if(
Profissao[L] == 25)
    {
        
SetPlayerColor(LCOR_MOTORISTAP);
    }
    else if(
Profissao[L] == 26)
    {
        
SetPlayerColor(LCOR_PARAMEDICO);
    }
    else if(
Profissao[L] == 27)
    {
        
SetPlayerColor(LCOR_PESCADOR);
    }
    else if(
Profissao[L] == 28)
    {
        
SetPlayerColor(LCOR_PETROLEIRO);
    }
    else if(
Profissao[L] == 29)
    {
        
SetPlayerColor(LCOR_PILOTO_DE_CORRIDA);
    }
    else if(
Profissao[L] == 30)
    {
        
SetPlayerColor(LCOR_PREFEITO);
    }
    else if(
Profissao[L] == 31)
    {
        
SetPlayerColor(LCOR_PROMOTER);
    }
    else if(
Profissao[L] == 32)
    {
        
SetPlayerColor(LCOR_RAPPER);
    }
    else if(
Profissao[L] == 33)
    {
        
SetPlayerColor(LCOR_RAPPER);
    }
    else if(
Profissao[L] == 34)
    {
        
SetPlayerColor(LCOR_TECNICO_DE_INFORMATICA);
    }
    else if(
Profissao[L] == 35)
    {
        
SetPlayerColor(LCOR_VENDEDOR_DE_CARROS);
    }
    else if(
Profissao[L] == 36)
    {
        
SetPlayerColor(LCOR_VENDEDOR_DE_ROUPAS);
    }
    else if(
Profissao[L] == 37)
    {
        
SetPlayerColor(LCOR_VIGIA);
    }
    else if(
Profissao[L] == 38)
    {
        
SetPlayerColor(LCOR_BOMBEIRO);
    }
    else if(
Profissao[L] == 39)
    {
        
SetPlayerColor(LCOR_CIA);
    }
    else if(
Profissao[L] == 40)
    {
        
SetPlayerColor(LCOR_ESQUADRAO_ANTI_BOMBAS);
    }
    else if(
Profissao[L] == 41)
    {
        
SetPlayerColor(LCOR_FBI);
    }
    else if(
Profissao[L] == 42)
    {
        
SetPlayerColor(LCOR_IBAMA);
    }
    else if(
Profissao[L] == 43)
    {
        
SetPlayerColor(LCOR_INTERPOL);
    }
    else if(
Profissao[L] == 44)
    {
        
SetPlayerColor(LCOR_NARCOTICOS);
    }
    else if(
Profissao[L] == 45)
    {
        
SetPlayerColor(LCOR_POLICIA_CIVIL);
    }
    else if(
Profissao[L] == 46)
    {
        
SetPlayerColor(LCOR_POLICIA_FEDERAL);
    }
    else if(
Profissao[L] == 47)
    {
        
SetPlayerColor(LCOR_POLICIA_FLORESTAL);
    }
    else if(
Profissao[L] == 48)
    {
        
SetPlayerColor(LCOR_POLICIA_RODOVIARIA);
    }
    else if(
Profissao[L] == 49)
    {
        
SetPlayerColor(LCOR_SWAT);
    }
    else if(
Profissao[L] == 50)
    {
        
SetPlayerColor(LCOR_ASSASSINO);
    }
    else if(
Profissao[L] == 51)
    {
        
SetPlayerColor(LCOR_ASSALTANTE);
    }
    else if(
Profissao[L] == 52)
    {
        
SetPlayerColor(LCOR_CAFETAO);
    }
    else if(
Profissao[L] == 53)
    {
        
SetPlayerColor(LCOR_CHEFE_DA_MAFIA);
    }
    else if(
Profissao[L] == 54)
    {
        
SetPlayerColor(LCOR_MATADOR_DE_ALUGUEL);
    }
    else if(
Profissao[L] == 55)
    {
        
SetPlayerColor(LCOR_PROSTITUTA);
    }
    else if(
Profissao[L] == 56)
    {
        
SetPlayerColor(LCOR_TERRORISTA);
    }
    else if(
Profissao[L] == 57)
    {
        
SetPlayerColor(LCOR_TRAFICANTE);
    }
    else if(
Profissao[L] == 58)
    {
        
SetPlayerColor(LCOR_VENDEDOR_DE_ARMAS);
    }
    else if(
Profissao[L] == 59)
    {
        
SetPlayerColor(LCOR_MAQUINISTA);
    }
    else if(
Profissao[L] == 60)
    {
        
SetPlayerColor(LCOR_MOTO_TAXI);
    }
    else if(
Profissao[L] == 61)
    {
        
SetPlayerColor(LCOR_MOTORISTA_DE_ONIBUS);
    }
    else if(
Profissao[L] == 62)
    {
        
SetPlayerColor(LCOR_PILOTO_DE_AVIAO);
    }
    else if(
Profissao[L] == 63)
    {
        
SetPlayerColor(LCOR_TAXISTA);
    }
    else if(
Profissao[L] == 64)
    {
        
SetPlayerColor(LCOR_FORЗA_AEREA);
    }
    else if(
Profissao[L] == 65)
    {
        
SetPlayerColor(LCOR_MARINHA);
    }
    else if(
Profissao[L] == 66)
    {
        
SetPlayerColor(LCOR_TERRESTRE);
    }
    else if(
Profissao[L] == 67)
    {
        
SetPlayerColor(LCOR_BISPO);
    }
    else if(
Profissao[L] == 68)
    {
        
SetPlayerColor(LCOR_JOGADOR_DE_FUTEBOL);
    }
    else if(
Profissao[L] == 69)
    {
        
SetPlayerColor(LCOR_PADRE);
    }
    else if(
Profissao[L] == 70)
    {
        
SetPlayerColor(LCOR_CARREGADOR);
    }
    else if(
Profissao[L] == 71)
    {
        
SetPlayerColor(LCOR_PORTEIRO_DO_CONDOMINIO);
    }
    else if(
Profissao[L] == 72)
    {
        
SetPlayerColor(LCOR_PORTEIRO_DA_VILA);
    }
    else if(
Profissao[L] == 73)
    {
        
SetPlayerColor(LCOR_SVILA);
    }
    else if(
Profissao[L] == 74)
    {
        
SetPlayerColor(LCOR_SCONDOMINIO);
    }
    else if(
Profissao[L] == 75)
    {
        
SetPlayerColor(LCOR_SCASSINO);
    }
    else if(
Profissao[L] == 76)
    {
        
SetPlayerColor(LCOR_SDETRAN);
    }
    return 
1;
}
return 
1;




Re: Loop em uma callbak - minimessi10 - 01.08.2013

pawn Код:
C:\Users\Marcelo\Documents\Servers\samp03x_svr_R1-2_win32\gamemodes\GM.pwn(6565) : error 025: function heading differs from prototype
C:\Users\Marcelo\Documents\Servers\samp03x_svr_R1-2_win32\gamemodes\GM.pwn(6567) : warning 219: local variable "L" shadows a variable at a preceding level
C:\Users\Marcelo\Documents\Servers\samp03x_svr_R1-2_win32\gamemodes\GM.pwn(6567) : warning 206: redundant test: constant expression is non-zero
C:\Users\Marcelo\Documents\Servers\samp03x_svr_R1-2_win32\gamemodes\GM.pwn(6883) : warning 209: function "OnPlayerSelectPos" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
public OnPlayerSelectPos(L)
pawn Код:
for(new L=0; MAX_PLAYERS; L++)
pawn Код:
}



Re: Loop em uma callbak - ProKillerpa - 01.08.2013

PHP код:
public OnPlayerSelectPos() 



Re: Loop em uma callbak - minimessi10 - 01.08.2013

pawn Код:
C:\Users\Marcelo\Documents\Servers\samp03x_svr_R1-2_win32\gamemodes\GM.pwn(6567) : warning 206: redundant test: constant expression is non-zero
C:\Users\Marcelo\Documents\Servers\samp03x_svr_R1-2_win32\gamemodes\GM.pwn(6883) : warning 209: function "OnPlayerSelectPos" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
pawn Код:
for(new L=0; MAX_PLAYERS; L++)
pawn Код:
}



Re: Loop em uma callbak - Standby - 01.08.2013

pawn Код:
public OnPlayerSelectPos(L)
{
for(new L=0; MAX_PLAYERS; L++)
{
    if(Profissao[L] == 0)
    {
        SetPlayerColor(L, COR_DESEMPREGADO);
    }
    else if(Profissao[L] == 1)
    {
        SetPlayerColor(L, COR_ADVOGADO);
    }
    else if(Profissao[L] == 2)
    {
        SetPlayerColor(L, COR_ALPINISTA);
    }
    else if(Profissao[L] == 3)
    {
        SetPlayerColor(L, COR_ASTRONOMO);
    }
    else if(Profissao[L] == 4)
    {
        SetPlayerColor(L, COR_APOSENTADO);
    }
    else if(Profissao[L] == 5)
    {
        SetPlayerColor(L, COR_BAILARINA);
    }
    else if(Profissao[L] == 6)
    {
        SetPlayerColor(L, COR_BANCARIO);
    }
    else if(Profissao[L] == 7)
    {
        SetPlayerColor(L, COR_BARMAN);
    }
    else if(Profissao[L] == 8)
    {
        SetPlayerColor(L, COR_CAMINHONEIRO);
    }
    else if(Profissao[L] == 9)
    {
        SetPlayerColor(L, COR_CACADOR);
    }
    else if(Profissao[L] == 10)
    {
        SetPlayerColor(L, COR_CHAVEIRO);
    }
    else if(Profissao[L] == 11)
    {
        SetPlayerColor(L, COR_CIENTISTA);
    }
    else if(Profissao[L] == 12)
    {
        SetPlayerColor(L, COR_DEPUTADO);
    }
    else if(Profissao[L] == 13)
    {
        SetPlayerColor(L, COR_DETETIVE);
    }
    else if(Profissao[L] == 14)
    {
        SetPlayerColor(L, COR_ENTREGADOR_DE_PIZZA);
    }
    else if(Profissao[L] == 15)
    {
        SetPlayerColor(L, COR_FARMACEUTICO);
    }
    else if(Profissao[L] == 16)
    {
        SetPlayerColor(L, COR_FRENTISTA);
    }
    else if(Profissao[L] == 17)
    {
        SetPlayerColor(L, COR_GARI);
    }
    else if(Profissao[L] == 18)
    {
        SetPlayerColor(L, COR_GOVERNADOR);
    }
    else if(Profissao[L] == 19)
    {
        SetPlayerColor(L, COR_GUARDA_COSTAS);
    }
    else if(Profissao[L] == 20)
    {
        SetPlayerColor(L, COR_INSTRUTOR);
    }
    else if(Profissao[L] == 21)
    {
        SetPlayerColor(L, COR_JORNALISTA);
    }
    else if(Profissao[L] == 22)
    {
        SetPlayerColor(L, COR_JUIZ);
    }
    else if(Profissao[L] == 23)
    {
        SetPlayerColor(L, COR_MATEMATICO);
    }
    else if(Profissao[L] == 23)
    {
        SetPlayerColor(L, COR_MECANICO);
    }
    else if(Profissao[L] == 24)
    {
        SetPlayerColor(L, COR_MINERADOR);
    }
    else if(Profissao[L] == 25)
    {
        SetPlayerColor(L, COR_MOTORISTAP);
    }
    else if(Profissao[L] == 26)
    {
        SetPlayerColor(L, COR_PARAMEDICO);
    }
    else if(Profissao[L] == 27)
    {
        SetPlayerColor(L, COR_PESCADOR);
    }
    else if(Profissao[L] == 28)
    {
        SetPlayerColor(L, COR_PETROLEIRO);
    }
    else if(Profissao[L] == 29)
    {
        SetPlayerColor(L, COR_PILOTO_DE_CORRIDA);
    }
    else if(Profissao[L] == 30)
    {
        SetPlayerColor(L, COR_PREFEITO);
    }
    else if(Profissao[L] == 31)
    {
        SetPlayerColor(L, COR_PROMOTER);
    }
    else if(Profissao[L] == 32)
    {
        SetPlayerColor(L, COR_RAPPER);
    }
    else if(Profissao[L] == 33)
    {
        SetPlayerColor(L, COR_RAPPER);
    }
    else if(Profissao[L] == 34)
    {
        SetPlayerColor(L, COR_TECNICO_DE_INFORMATICA);
    }
    else if(Profissao[L] == 35)
    {
        SetPlayerColor(L, COR_VENDEDOR_DE_CARROS);
    }
    else if(Profissao[L] == 36)
    {
        SetPlayerColor(L, COR_VENDEDOR_DE_ROUPAS);
    }
    else if(Profissao[L] == 37)
    {
        SetPlayerColor(L, COR_VIGIA);
    }
    else if(Profissao[L] == 38)
    {
        SetPlayerColor(L, COR_BOMBEIRO);
    }
    else if(Profissao[L] == 39)
    {
        SetPlayerColor(L, COR_CIA);
    }
    else if(Profissao[L] == 40)
    {
        SetPlayerColor(L, COR_ESQUADRAO_ANTI_BOMBAS);
    }
    else if(Profissao[L] == 41)
    {
        SetPlayerColor(L, COR_FBI);
    }
    else if(Profissao[L] == 42)
    {
        SetPlayerColor(L, COR_IBAMA);
    }
    else if(Profissao[L] == 43)
    {
        SetPlayerColor(L, COR_INTERPOL);
    }
    else if(Profissao[L] == 44)
    {
        SetPlayerColor(L, COR_NARCOTICOS);
    }
    else if(Profissao[L] == 45)
    {
        SetPlayerColor(L, COR_POLICIA_CIVIL);
    }
    else if(Profissao[L] == 46)
    {
        SetPlayerColor(L, COR_POLICIA_FEDERAL);
    }
    else if(Profissao[L] == 47)
    {
        SetPlayerColor(L, COR_POLICIA_FLORESTAL);
    }
    else if(Profissao[L] == 48)
    {
        SetPlayerColor(L, COR_POLICIA_RODOVIARIA);
    }
    else if(Profissao[L] == 49)
    {
        SetPlayerColor(L, COR_SWAT);
    }
    else if(Profissao[L] == 50)
    {
        SetPlayerColor(L, COR_ASSASSINO);
    }
    else if(Profissao[L] == 51)
    {
        SetPlayerColor(L, COR_ASSALTANTE);
    }
    else if(Profissao[L] == 52)
    {
        SetPlayerColor(L, COR_CAFETAO);
    }
    else if(Profissao[L] == 53)
    {
        SetPlayerColor(L, COR_CHEFE_DA_MAFIA);
    }
    else if(Profissao[L] == 54)
    {
        SetPlayerColor(L, COR_MATADOR_DE_ALUGUEL);
    }
    else if(Profissao[L] == 55)
    {
        SetPlayerColor(L, COR_PROSTITUTA);
    }
    else if(Profissao[L] == 56)
    {
        SetPlayerColor(L, COR_TERRORISTA);
    }
    else if(Profissao[L] == 57)
    {
        SetPlayerColor(L, COR_TRAFICANTE);
    }
    else if(Profissao[L] == 58)
    {
        SetPlayerColor(L, COR_VENDEDOR_DE_ARMAS);
    }
    else if(Profissao[L] == 59)
    {
        SetPlayerColor(L, COR_MAQUINISTA);
    }
    else if(Profissao[L] == 60)
    {
        SetPlayerColor(L, COR_MOTO_TAXI);
    }
    else if(Profissao[L] == 61)
    {
        SetPlayerColor(L, COR_MOTORISTA_DE_ONIBUS);
    }
    else if(Profissao[L] == 62)
    {
        SetPlayerColor(L, COR_PILOTO_DE_AVIAO);
    }
    else if(Profissao[L] == 63)
    {
        SetPlayerColor(L, COR_TAXISTA);
    }
    else if(Profissao[L] == 64)
    {
        SetPlayerColor(L, COR_FORЗA_AEREA);
    }
    else if(Profissao[L] == 65)
    {
        SetPlayerColor(L, COR_MARINHA);
    }
    else if(Profissao[L] == 66)
    {
        SetPlayerColor(L, COR_TERRESTRE);
    }
    else if(Profissao[L] == 67)
    {
        SetPlayerColor(L, COR_BISPO);
    }
    else if(Profissao[L] == 68)
    {
        SetPlayerColor(L, COR_JOGADOR_DE_FUTEBOL);
    }
    else if(Profissao[L] == 69)
    {
        SetPlayerColor(L, COR_PADRE);
    }
    else if(Profissao[L] == 70)
    {
        SetPlayerColor(L, COR_CARREGADOR);
    }
    else if(Profissao[L] == 71)
    {
        SetPlayerColor(L, COR_PORTEIRO_DO_CONDOMINIO);
    }
    else if(Profissao[L] == 72)
    {
        SetPlayerColor(L, COR_PORTEIRO_DA_VILA);
    }
    else if(Profissao[L] == 73)
    {
        SetPlayerColor(L, COR_SVILA);
    }
    else if(Profissao[L] == 74)
    {
        SetPlayerColor(L, COR_SCONDOMINIO);
    }
    else if(Profissao[L] == 75)
    {
        SetPlayerColor(L, COR_SCASSINO);
    }
    else if(Profissao[L] == 76)
    {
        SetPlayerColor(L, COR_SDETRAN);
    }
}
    return 1;
}