[Ajuda] /aceitar convite
#1

Meu problema й o seguinte quando convido um player com lider estб tudo ok, mas, quando convido com Sub-lider o player aceita o convite e cai no Spawn Civil e nгo entra na ORG. Estava mexendo e acho que descobri onde й o erro, mas nгo sei como arrumar. O ERRO provavelmente esta nesta linha aki (PlayerInfo[playerid][pMembro] = PlayerInfo[InviteOffer[playerid]][pLider]) , ou seja (pLider), somente o lider vai dar certo. Se eu colocar a linha assim (PlayerInfo[playerid][pMembro] = PlayerInfo[InviteOffer[playerid]][pCargo] == 5) somente o Sub-lider poderб convidar. Como posso fazer pros 2 darem certo. Segue o cуdigo completo abaixo:

PHP Code:
    if(strcmp(cmd,"/aceitar",true)==0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
x_Emprego[32];
            
x_Emprego strtok(cmdtextidx);
            if(!
strlen(x_Emprego))
            {
                
SendClientMessage(playeridCOLOR_WHITE"|_______________ Aceitar _______________A");
                
SendClientMessage(playeridCOLOR_WHITE"Use: aceitar [nome]");
                
SendClientMessage(playeridCOLOR_GREY"Nomes Validos: drogas, Reparo, Advogado, seguranзa, convite, aovivo, Refill , Assalto, Convite");
                
SendClientMessage(playeridCOLOR_GREY"Nomes Validos: Carro, Multa ,divorcio, mendigo, blindagem, Dinamite");
                return 
1;
            }
            if(
strcmp(x_Emprego,"convite",true) == 0)
            {
                if(
InviteOffer[playerid] < 999)
                {
                    if(
IsPlayerConnected(InviteOffer[playerid]))
                    {
                        if(
PlayerInfo[playerid][pEmprego] > 1)
                        {
                             
SendClientMessage(playeridCOLOR_YELLOW"Voce possui um emprego /sairdoemprego.");
                                return 
1;
                        }
                        if(
convidado[playerid] == 0)
                        {
                             
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo foi convidado para nenhuma organizaзгo.");
                             return 
1;
                        }
                        
skincop[playerid] = GetPlayerSkin(playerid);
                        if(
PlayerInfo[InviteOffer[playerid]][pLider] == 1) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                         else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 2) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 3) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 4) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 5) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 6) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 7) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 8) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; }
                         else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 9) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 10) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 11) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 12) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 13) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 14) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 15) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 16) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 17) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 18) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 19) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 20) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 21) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 22) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 23) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 24) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 25) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 26) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 27) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 28) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 29) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 30) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; }
                          
//sub-lider
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 1) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//governo
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 2) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//pm
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 3) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//bope
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 4) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//fbi
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 5) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//swat
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 6) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//medico
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 7) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//mecanicos
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 8) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//reportes
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 9) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//taxistas
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 10) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//the triads
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 11) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//hitmans
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 12) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//mafia cn
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 13) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//yakuza
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 14) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//los vagos
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 15) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//grove
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 16) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//ballas
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 17) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//alqaeda
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 18) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//ei
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 19) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//exercito
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 20) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//sons
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 21) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//devils
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 22) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//interpol
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 23) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//ada
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 24) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//tcp
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 25) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//pcc
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 26) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//cv
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 27) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//pc
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 28) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//taliban
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 29) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//mafia j
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 30) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//mafia m
                        
convidado[playerid] = 0;
                          
PlayerInfo[playerid][pMembro] = PlayerInfo[InviteOffer[playerid]][pLider]; //Provavel erro
                        
PlayerInfo[playerid][pCargo] = 1;
                           
format(gstring128"* %s aceitou seu convite para entrar na sua organizaзгo."PlayerName(playerid));
                           
SendClientMessage(InviteOffer[playerid], COLOR_LIGHTBLUEgstring);
                        
format(gstringsizeof(gstring), "* Vocк aceitou o convite de %s para entrar para organizaзгo: %s, parabйns."PlayerName(InviteOffer[playerid]), NomeORG(InviteOffer[playerid]));
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEgstring);
                        
ConviteInfoOrg(PlayerName(playerid), InviteJob[playerid], 1);
                        if(
PlayerInfo[playerid][pMembro] == 1) { PlayerInfo[playerid][pDepartamentoLS] = 1; }
                        if(
PlayerInfo[playerid][pMembro] == 5) { PlayerInfo[playerid][pDepartamentoLS] = 1; }
                        if(
PlayerInfo[playerid][pMembro] == 6) { PlayerInfo[playerid][pDepartamentoLS] = 1; }
                        if(
PlayerInfo[playerid][pMembro] == 7) { PlayerInfo[playerid][pDepartamentoLS] = 1; }
                        if(
PlayerInfo[playerid][pMembro] == 27) { PlayerInfo[playerid][pDepartamentoLS] = 1; }
                        
SetPlayerSpawn(playerid);
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GREY"O jogador que lhe convidou nгo estб conectado.");
                        return 
1;
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"Vocк nгo foi convidado para nenhuma organizaзгo.");
                    return 
1;
                }
            } 
Reply
#2

Meu problema й o seguinte quando convido um player com lider estб tudo ok, mas, quando convido com Sub-lider o player aceita o convite e cai no Spawn Civil e nгo entra na ORG. Estava mexendo e acho que descobri onde й o erro, mas nгo sei como arrumar. O ERRO provavelmente esta nesta linha aki (PlayerInfo[playerid][pMembro] = PlayerInfo[InviteOffer[playerid]][pLider]) , ou seja (pLider), somente o lider vai dar certo. Se eu colocar a linha assim (PlayerInfo[playerid][pMembro] = PlayerInfo[InviteOffer[playerid]][pCargo] == 5) somente o Sub-lider poderб convidar. Como posso fazer pros 2 darem certo. Segue o cуdigo completo abaixo:

PHP Code:

if(strcmp(cmd,"/aceitar",true)==0
    { 
        if(
IsPlayerConnected(playerid)) 
        { 
            new 
x_Emprego[32]; 
            
x_Emprego strtok(cmdtextidx); 
            if(!
strlen(x_Emprego)) 
            { 
                
SendClientMessage(playeridCOLOR_WHITE"|_______________ Aceitar _______________A"); 
                
SendClientMessage(playeridCOLOR_WHITE"Use: aceitar [nome]"); 
                
SendClientMessage(playeridCOLOR_GREY"Nomes Validos: drogas, Reparo, Advogado, seguranзa, convite, aovivo, Refill , Assalto, Convite"); 
                
SendClientMessage(playeridCOLOR_GREY"Nomes Validos: Carro, Multa ,divorcio, mendigo, blindagem, Dinamite"); 
                return 
1
            } 
            if(
strcmp(x_Emprego,"convite",true) == 0
            { 
                if(
InviteOffer[playerid] < 999
                { 
                    if(
IsPlayerConnected(InviteOffer[playerid])) 
                    { 
                        if(
PlayerInfo[playerid][pEmprego] > 1
                        { 
                             
SendClientMessage(playeridCOLOR_YELLOW"Voce possui um emprego /sairdoemprego."); 
                                return 
1
                        } 
                        if(
convidado[playerid] == 0
                        { 
                             
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo foi convidado para nenhuma organizaзгo."); 
                             return 
1
                        } 
                        
skincop[playerid] = GetPlayerSkin(playerid); 
                        if(
PlayerInfo[InviteOffer[playerid]][pLider] == 1) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                         else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 2) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 3) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 4) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 5) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 6) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 7) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 8) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } 
                         else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 9) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 10) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 11) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 12) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 13) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 14) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 15) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 16) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 17) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 18) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 19) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 20) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 21) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 22) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 23) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 24) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 25) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 26) { SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 27) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 28) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 29) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                        else if(
PlayerInfo[InviteOffer[playerid]][pLider] == 30) { SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } 
                          
//sub-lider 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 1) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//governo 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 2) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//pm 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 3) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//bope 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 4) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//fbi 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 5) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//swat 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 6) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//medico 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 7) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//mecanicos 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 8) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//reportes 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 9) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//taxistas 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 10) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//the triads 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 11) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//hitmans 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 12) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//mafia cn 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 13) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//yakuza 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 14) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//los vagos 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 15) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//grove 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 16) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//ballas 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 17) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//alqaeda 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 18) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//ei 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 19) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//exercito 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 20) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//sons 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 21) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//devils 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 22) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//interpol 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 23) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//ada 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 24) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//tcp 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 25) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//pcc 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 26) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//cv 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 27) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//pc 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 28) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//taliban 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 29) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//mafia j 
                        
else if(PlayerInfo[InviteOffer[playerid]][pMembro] == 30) { if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//mafia m 
                        
convidado[playerid] = 0
                          
PlayerInfo[playerid][pMembro] = PlayerInfo[InviteOffer[playerid]][pLider]; //Provavel erro 
                        
PlayerInfo[playerid][pCargo] = 1
                           
format(gstring128"* %s aceitou seu convite para entrar na sua organizaзгo."PlayerName(playerid)); 
                           
SendClientMessage(InviteOffer[playerid], COLOR_LIGHTBLUEgstring); 
                        
format(gstringsizeof(gstring), "* Vocк aceitou o convite de %s para entrar para organizaзгo: %s, parabйns."PlayerName(InviteOffer[playerid]), NomeORG(InviteOffer[playerid])); 
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEgstring); 
                        
ConviteInfoOrg(PlayerName(playerid), InviteJob[playerid], 1); 
                        if(
PlayerInfo[playerid][pMembro] == 1) { PlayerInfo[playerid][pDepartamentoLS] = 1; } 
                        if(
PlayerInfo[playerid][pMembro] == 5) { PlayerInfo[playerid][pDepartamentoLS] = 1; } 
                        if(
PlayerInfo[playerid][pMembro] == 6) { PlayerInfo[playerid][pDepartamentoLS] = 1; } 
                        if(
PlayerInfo[playerid][pMembro] == 7) { PlayerInfo[playerid][pDepartamentoLS] = 1; } 
                        if(
PlayerInfo[playerid][pMembro] == 27) { PlayerInfo[playerid][pDepartamentoLS] = 1; } 
                        
SetPlayerSpawn(playerid); 
                    } 
                    else 
                    { 
                        
SendClientMessage(playeridCOLOR_GREY"O jogador que lhe convidou nгo estб conectado."); 
                        return 
1
                    } 
                } 
                else 
                { 
                    
SendClientMessage(playeridCOLOR_GREY"Vocк nгo foi convidado para nenhuma organizaзгo."); 
                    return 
1
                } 
            } 
Reply
#3

Cara.
Faзa um enum para guardar as informaзхes das orgs.

Por exemplo:

Organization[orgid][Lider]
Organization[orgid][SubLider][2]
Organization[orgid][Membros][30]

No player, vocк sу salva o ID da organizaзгo que ele pertence, e o cargo.

Assim vocк pode fazer esse comando de convidar utilizando pouquнssimas linhas.
Reply
#4

de uma olhada em Switch() & Case:, ele й praticamente 100X mais rapido que IF, e deixa o codigo bem mais limpo!
Observe:
PHP Code:
if(strcmp(cmd,"/aceitar",true)==0)  
    {  
        new 
x_Emprego[32];  
        
x_Emprego strtok(cmdtextidx);  
        if(!
strlen(x_Emprego))  
        {  
            
SendClientMessage(playeridCOLOR_WHITE"|_______________ Aceitar _______________A");  
            
SendClientMessage(playeridCOLOR_WHITE"Use: aceitar [nome]");  
            
SendClientMessage(playeridCOLOR_GREY"Nomes Validos: drogas, Reparo, Advogado, seguranзa, convite, aovivo, Refill , Assalto, Convite");  
            return 
SendClientMessage(playeridCOLOR_GREY"Nomes Validos: Carro, Multa ,divorcio, mendigo, blindagem, Dinamite");  
        }  
        if(
strcmp(x_Emprego,"convite",true) == 0)  
        {  
            if(
InviteOffer[playerid] < 999)  
            {  
                if(
IsPlayerConnected(InviteOffer[playerid]))  
                {  
                    if(
PlayerInfo[playerid][pEmprego] > 1) return SendClientMessage(playeridCOLOR_YELLOW"Voce possui um emprego /sairdoemprego.");  
                    if(
convidado[playerid] == 0)  return SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo foi convidado para nenhuma organizaзгo.");  
                    
skincop[playerid] = GetPlayerSkin(playerid);
                    switch(
PlayerInfo[InviteOffer[playerid]][pLider])
                    {
                        case 
1,2,3,4,7,12,13,17,25:{SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2;}  
                        case 
6,11,15..24,27..30:{SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5;}  
                        case 
8,9,10,14,26:{SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10;}  
                    }
                    switch(
PlayerInfo[InviteOffer[playerid]][pMembro])
                    { 
                        case 
1..6,19,22,27:{ if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5) { SetSpawnInfo(playerid2PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2; } }//governo  
                        
case 7..11:{ if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid10PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10; } }//mecanicos  
                        
case 12..18,20,21,23,24,25,26,28,29,30:{if(PlayerInfo[InviteOffer[playerid]][pCargo] == 5){ SetSpawnInfo(playerid5PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5; } }//mafia cn  
                    
}    
                    
convidado[playerid] = 0;  
                    
PlayerInfo[playerid][pMembro] = PlayerInfo[InviteOffer[playerid]][pLider]; //Provavel erro  
                    
PlayerInfo[playerid][pCargo] = 1;  
                    
format(gstring128"* %s aceitou seu convite para entrar na sua organizaзгo."PlayerName(playerid));  
                    
SendClientMessage(InviteOffer[playerid], COLOR_LIGHTBLUEgstring);  
                    
format(gstringsizeof(gstring), "* Vocк aceitou o convite de %s para entrar para organizaзгo: %s, parabйns."PlayerName(InviteOffer[playerid]), NomeORG(InviteOffer[playerid]));  
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEgstring);  
                    
ConviteInfoOrg(PlayerName(playerid), InviteJob[playerid], 1);  
                    if(
PlayerInfo[playerid][pMembro] == 1) { PlayerInfo[playerid][pDepartamentoLS] = 1; }  
                    if(
PlayerInfo[playerid][pMembro] == 5) { PlayerInfo[playerid][pDepartamentoLS] = 1; }  
                    if(
PlayerInfo[playerid][pMembro] == 6) { PlayerInfo[playerid][pDepartamentoLS] = 1; }  
                    if(
PlayerInfo[playerid][pMembro] == 7) { PlayerInfo[playerid][pDepartamentoLS] = 1; }  
                    if(
PlayerInfo[playerid][pMembro] == 27) { PlayerInfo[playerid][pDepartamentoLS] = 1; }  
                     
SetPlayerSpawn(playerid);  
                }  
                else  return 
SendClientMessage(playeridCOLOR_GREY"O jogador que lhe convidou nгo estб conectado.");  
            }  
            else return 
SendClientMessage(playeridCOLOR_GREY"Vocк nгo foi convidado para nenhuma organizaзгo.");  
       } 
Tambem use: "else return SendClientMessage(...);" porque ele vai ler sу uma linha, do else, e o SendClientMessage retorna 1 se o player esta conectado
Reply
#5

Esse cуdigo nгo deu certo, o pawno atй parou de funcionar
Reply
#6

Quote:
Originally Posted by ViniFox
View Post
Esse cуdigo nгo deu certo, o pawno atй parou de funcionar
Revise o Codigo nй, Eu mostrei um exemplo, nгo copiei todo o codigo, nem revisei se tava certo, agora se quiser usar ele ponha a mгo na massa!

PHP Code:
#PS: "eu nгo coloquei uma '}' no final, sу para ver se tu tava atento
#e nгo sу copiando e colando! kkk" 
Reply
#7

cara, eu nгo quero trocar o cуdigo. Eu estou querendo uma opniao de outro scripter, pois eu sei a linha onde estб o problema, mas, nгo sei como resolver. Por isso estou pedindo ajuda...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)