[Ajuda] comando /admins e /contratos
#1

Estou com alguns problemas em comandos do meu servidor, como o /admins e /contratos, o /admins aparece somente 1 admin na msgbox, codigo:
PHP Code:
if (strcmp(cmd"/admins"true) == 0)
    {
        for(new 
0<= MaiorIDi++)
        {
            if(
IsPlayerConnected(i) == && PlayerInfo[i][pAdmin] > 0)
            {
                if(
HideAdm[i] == 0)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    new 
lolz[35];
                    new 
lolz2[35];
                    if(
PlayerInfo[i][pAdmin] == 1)
                    {
                        
lolz "{DAA520}Ajudante{FFFFFF}";
                    }
                    if(
PlayerInfo[i][pAdmin] == 2)
                    {
                        
lolz "{FFA500}Moderador{FFFFFF}";
                    }
                    if(
PlayerInfo[i][pAdmin] == 3)
                    {
                        
lolz "{FF7F50}Auxiliar{FFFFFF}";
                    }
                    if(
PlayerInfo[i][pAdmin] == 4)
                    {
                        
lolz "{8A2BE2}Pre-Master{FFFFFF}";
                    }
                    if(
PlayerInfo[i][pAdmin] == 5)
                    {
                        
lolz "{4B0082}Master{FFFFFF}";
                    }
                    if(
PlayerInfo[i][pAdmin] == 6)
                    {
                        
lolz "{FFC0CB}MasterPlus{FFFFFF}";
                    }
                    if(
PlayerInfo[i][pAdmin] == 8)
                    {
                        
lolz "{B22222}Sub-Dono{FFFFFF}";
                    }
                    if(
PlayerInfo[i][pAdmin] == 10 && PlayerInfo[i][pSex] == 1)
                    {
                        
lolz "{008000}Desenvolvedor{FFFFFF}";
                    }
                    if(
PlayerInfo[i][pAdmin] == 10 && PlayerInfo[i][pSex] == 2)
                    {
                        
lolz "DONA/SCRIPTER";
                    }
                    if(
admtrampando[i] == 1)
                    {
                    
lolz2 "{FF0000}Trabalhando{FFFFFF}";
                    }
                    if(
admtrampando[i] == 0)
                    {
                    
lolz2 "{FFCCFF}Jogando{FFFFFF}";
                    }
                    if(
gPlayerLogged[i] == 1)
                    {
                        new 
DialogAdmins[1500];
                            
format(string128" %s (%s) Modo: [{FF0000}%s{FFFFFF}]\n"sendernamelolzlolz2);
                            
strcat(DialogAdmins,string);
                            
ShowPlayerDialog(playerid9938DIALOG_STYLE_MSGBOX"{32CD32}Administradores Online",DialogAdmins,"Ok","");
                        }
                         else
                        {
                            
SendClientMessage(playeridCOLOR_ORANGE"Administraзгo Offline no momento.");
                   }
            }
      }
}
        return 
1;
    } 
Tenho um problema parecido no /contratos que nгo aparece o mandante.
Comando para colocar um jogador em contrato:
PHP Code:
if(strcmp(cmd"/contrato"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
           {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USE: /contrato [ID/Nome]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            if (
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    if(
PlayerInfo[giveplayerid][pLevel] < 10)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"  O jogador nгo possui level para ser posto em contrato.");
                        return 
1;
                    }
                    else if(
PlayerInfo[giveplayerid][pContract] == 1)
                    {
                    
SendClientMessage(playeridCOLOR_PURPLE" O jogador jб estб em contrato.");
                    return 
1;
                    }
                    else if(
PlayerInfo[playerid][pMembro] == 24||PlayerInfo[playerid][pLider] == 24||PlayerInfo[playerid][pMembro] == 8||PlayerInfo[playerid][pLider] == 8)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"   Assassinos nгo podem colocar contratos!");
                        return 
1;
                    }
                    else if(
GetGranaVinny(playerid) < 3000)
                    {
                        
SendClientMessage(playeridCOLOR_GREY" Vocк nгo possui dinheiro suficiente para colocar contratos.");
                        return 
1;
                    }
                    if(
giveplayerid == playerid) { SendClientMessage(playeridCOLOR_GREY"Nao pode colocar contrato em si mesmo!"); return 1; }
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        if(
IsPlayerConnected(giveplayerid))
                            {
                             
PlayerInfo[giveplayerid][pContract] = 1;
                             
GranaVinny(playerid, (3000));
                             
PlayerInfo[giveplayerid][pHeadValue]+=moneys;
                             
format(stringsizeof(string), "%s Colocou um contrato em %s[%d], no valor de $3000.",sendernamegiveplayergiveplayerid);
                             
SendFamilyMessage(8COLOR_PURPLEstring);
                             
SendFamilyMessage(24COLOR_PURPLEstring);
                             
format(stringsizeof(string), "* Vocк colocou um contrato em %s, no valor de $3000.",giveplayermoneys);
                             
SendClientMessage(playeridCOLOR_PURPLEstring);
                             
PlayerPlaySound(playerid10520.00.00.0);
                             
Mandante[giveplayerid] = playerid;
                             return 
1;
                             }
                        else
                        {
                        
SendClientMessage(playeridCOLOR_GREY"  ID Invalido.");
                        return 
1;
                        }
                    }
                }
           }
       } 
Comando para ver quem estб em contrato:
PHP Code:
 if(strcmp(cmd"/contratos"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
           {
            if(
PlayerInfo[playerid][pMembro] != 24 && PlayerInfo[playerid][pLider] != 24 && PlayerInfo[playerid][pMembro] != && PlayerInfo[playerid][pLider] != 8)
            {
               
SendClientMessage(playeridCOLOR_GREY"   Apenas Assassinos podem usar esse comando!");
               return 
1;
                }
                 new 
DialogContratos[1500];
                for(new 
i=0MaiorIDi++)
                {
                    if(
IsPlayerConnected(i))
                    {
                        if(
PlayerInfo[i][pContract] > 0)
                        {
                            
GetPlayerName(igiveplayersizeof(giveplayer));
                            
format(string128"%s[%d]              %s"giveplayer,i,Mandante[i]);
                            
strcat(DialogContratos,string);
                            
ShowPlayerDialog(playerid9937DIALOG_STYLE_LIST"Matar                           Mandante do Crime",DialogContratos,"Ok","Sair");
                            return 
1;
                        }
                        if(
PlayerInfo[i][pContract] < 1)
                        {
                       
SendClientMessage(playeridCOLOR_LIGHTRED"Nгo hб jogadores em contrato no momento.");
                       return 
1;
                    }
                  }
               }
            }
         } 
Reply
#2

PHP Code:
if(strcmp(cmd"/admins"true) == 0) {
    new 
DialogAdmins[1500], bradokscount 0;
    for(new 
0<= MaiorIDi++) {
        if(
IsPlayerConnected(i) == && PlayerInfo[i][pAdmin] > 0) {
            if(
HideAdm[i] == 0) {
                
GetPlayerName(isendernamesizeof(sendername));
                new 
lolz[35], new lolz2[35];
                switch(
PlayerInfo[i][pAdmin]) {
                    case 
1: { lolz "{DAA520}Ajudante{FFFFFF}";   }
                    case 
2: { lolz "{FFA500}Moderador{FFFFFF}";  }
                    case 
3: { lolz "{FF7F50}Auxiliar{FFFFFF}";   }
                    case 
4: { lolz "{8A2BE2}Pre-Master{FFFFFF}"; }
                    case 
5: { lolz "{4B0082}Master{FFFFFF}";     }
                    case 
6: { lolz "{FFC0CB}MasterPlus{FFFFFF}"; }
                    case 
8: { lolz "{B22222}Sub-Dono{FFFFFF}";   }
                }
                
lolz PlayerInfo[i][pAdmin] == 10 && PlayerInfo[i][pSex] == "{008000}Desenvolvedor{FFFFFF}" "DONA/SCRIPTER";
                
lolz2 admtrampando[i] == "{FFCCFF}Jogando{FFFFFF}" "{FF0000}Trabalhando{FFFFFF}";
                
format(string128" %s (%s) Modo: [{FF0000}%s{FFFFFF}]\n"sendernamelolzlolz2);
                
strcat(DialogAdminsstring);
                
bradokscount++;
            }
        }
    }
    if(
bradokscount == 0) return SendClientMessage(playeridCOLOR_ORANGE"Administraзгo Offline no momento.");
     else 
ShowPlayerDialog(playerid9938DIALOG_STYLE_MSGBOX"{32CD32}Administradores Online"DialogAdmins"Ok""");
    return 
1;

Reply
#3

PHP Code:
format(Mandante[giveplayerid], sizeof(Mandante[giveplayerid]), "%s"sendername); 
Faзa a substituiзгo para essa no comando /contrato.

Esse comando estб errado, por sinal...
Estude o comando fornecido pelo Leonardo (Seu_Madruga) e verifique onde vocк estб errando.
Reply
#4

Quote:
Originally Posted by [BOPE]Seu._.Madruga
View Post
PHP Code:
if(strcmp(cmd"/admins"true) == 0) {
    new 
DialogAdmins[1500], bradokscount 0;
    for(new 
0<= MaiorIDi++) {
        if(
IsPlayerConnected(i) == && PlayerInfo[i][pAdmin] > 0) {
            if(
HideAdm[i] == 0) {
                
GetPlayerName(isendernamesizeof(sendername));
                new 
lolz[35], new lolz2[35];
                switch(
PlayerInfo[i][pAdmin]) {
                    case 
1: { lolz "{DAA520}Ajudante{FFFFFF}";   }
                    case 
2: { lolz "{FFA500}Moderador{FFFFFF}";  }
                    case 
3: { lolz "{FF7F50}Auxiliar{FFFFFF}";   }
                    case 
4: { lolz "{8A2BE2}Pre-Master{FFFFFF}"; }
                    case 
5: { lolz "{4B0082}Master{FFFFFF}";     }
                    case 
6: { lolz "{FFC0CB}MasterPlus{FFFFFF}"; }
                    case 
8: { lolz "{B22222}Sub-Dono{FFFFFF}";   }
                }
                
lolz PlayerInfo[i][pAdmin] == 10 && PlayerInfo[i][pSex] == "{008000}Desenvolvedor{FFFFFF}" "DONA/SCRIPTER";
                
lolz2 admtrampando[i] == "{FFCCFF}Jogando{FFFFFF}" "{FF0000}Trabalhando{FFFFFF}";
                
format(string128" %s (%s) Modo: [{FF0000}%s{FFFFFF}]\n"sendernamelolzlolz2);
                
strcat(DialogAdminsstring);
                
bradokscount++;
            }
        }
    }
    if(
bradokscount == 0) return SendClientMessage(playeridCOLOR_ORANGE"Administraзгo Offline no momento.");
     else 
ShowPlayerDialog(playerid9938DIALOG_STYLE_MSGBOX"{32CD32}Administradores Online"DialogAdmins"Ok""");
    return 
1;

Consegui mano vlw pela ajuda! Sу ficou 1 problema.
Reply
#5

Quote:
Originally Posted by ipsLuan
View Post
PHP Code:
format(Mandante[giveplayerid], sizeof(Mandante[giveplayerid]), "%s"sendername); 
estб dando esse erro:
error: 080: unknown symbol, or not a constant symbol (symbol "giveplayerid")
Reply
#6

Obviamente vai ocorrer o erro jб que vocк atualizou o cуdigo para o do Seu Madruga
Reply
#7

Quote:
Originally Posted by Felipealves
View Post
Obviamente vai ocorrer o erro jб que vocк atualizou o cуdigo para o do Seu Madruga
O problema ficou na parte dos contratos, no (Mandante), a do /admins eu adptei.
Reply
#8

PHP Code:
new giveplayer[MAX_PLAYER_NAME+1]; 
Reply
#9

Quote:
Originally Posted by Felipealves
View Post
PHP Code:
new giveplayer[MAX_PLAYER_NAME+1]; 
nгo funcionou man.
Reply
#10

Troque a sua variбvel Mandante para essa:

PHP Code:
new Mandante[MAX_PLAYERS][24]; 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)