#1

Hello! I have a problem to /leaders, show only a leader .. help me


PHP код:
    if(strcmp(cmd"/leaders"true) == || strcmp(cmd"/lideri"true) == 0)
    {
        new 
count 0;
        if(
IsPlayerConnected(playerid))
        {
            for(new 
0MAX_PLAYERSi++)
            {
                if(
PlayerInfo[i][pLeader] >= 1)
                {
                      new 
idtext[100];
                    if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 1) { format(idtext,sizeof(idtext),"{0000FF}Police Departament{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 2) { format(idtext,sizeof(idtext),"{0000FF}National Guard{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 3) { format(idtext,sizeof(idtext),"{FF6347}Paramedic{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 4) { format(idtext,sizeof(idtext),"{373837}The Russian Mafia{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 5) { format(idtext,sizeof(idtext),"{1C7D19}Grove Street{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 6) { format(idtext,sizeof(idtext),"{F2B407}Los Vagos{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 7) { format(idtext,sizeof(idtext),"{DDA0DD}News Reporter{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 8) { format(idtext,sizeof(idtext),"{FFFF00}Taxi Cab Company{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 9) { format(idtext,sizeof(idtext),"{00FFFF}School Instructor{FFFFFF}"); }
                    else if(
PlayerInfo[i][pMember] == 10 || PlayerInfo[i][pLeader] == 10) { format(idtext,sizeof(idtext),"{FFDEAD}Tow Car Company{FFFFFF}"); }
                    
GetPlayerName(igiveplayersizeof(giveplayer));
                    
count ++;
                    new 
string2[1024];
                    if(
count == 0)
                    {
                        
format(string2sizeof(string2), "{FFFFFF}• Leader %s: %s[ID: %d] | Numar de telefon: {FFEA00}%d\n",idtextgiveplayeriPlayerInfo[i][pPhoneNumber]);
                    }
                    else if(
count 0)
                    {
                        
format(string2sizeof(string2), "%s{FFFFFF}• Leader %s: %s[ID: %d] | Numar de telefon: {FFEA00}%d\n{FFFFFF}",string2,idtextgiveplayeriPlayerInfo[i][pPhoneNumber]);
                    }
                    
ShowPlayerDialog(playerid77DIALOG_STYLE_MSGBOX"Leaders:"string2"Ok""");
                }
            }
            if(
count == 0) return SCM(playerid, -1"* Nu sunt lideri online!");
        }
        return 
1;
    } 
Reply
#2

help me
Reply
#3

PHP код:
if(strcmp(cmd"/leaders"true) == || strcmp(cmd"/lideri"true) == 0
    { 
        new 
string[120],bigstr[600],bool:is=false
        for(new 
0MAX_PLAYERSi++) 
        { 
            if(
PlayerInfo[i][pLeader] || PlayerInfo[i][pMember]) 
            { 
                if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 1string="{0000FF}Police Departament{FFFFFF}");
                else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 2string="{0000FF}National Guard{FFFFFF}");
                else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 3string="{FF6347}Paramedic{FFFFFF}"); 
                else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 4string="{373837}The Russian Mafia{FFFFFF}");
                else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 5string="{1C7D19}Grove Street{FFFFFF}");
                else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 6string="{F2B407}Los Vagos{FFFFFF}");
                else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 7string="{DDA0DD}News Reporter{FFFFFF}");
                else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 8string="{FFFF00}Taxi Cab Company{FFFFFF}");
                else if(
PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 9string="{00FFFF}School Instructor{FFFFFF}");
                else if(
PlayerInfo[i][pMember] == 10 || PlayerInfo[i][pLeader] == 10string="{FFDEAD}Tow Car Company{FFFFFF}");
                
GetPlayerName(igiveplayersizeof(giveplayer)); 
                
format(stringsizeof(string), "Leader %s: %s[ID: %d]\n",idtext,giveplayer,i);  
                
strcat(bigstr,string);
                if(
is==false)is=true;
            } 
        } 
        if(
is==false) return SCM(playerid, -1"* Nu sunt lideri online!"); 
        
ShowPlayerDialog(playerid77DIALOG_STYLE_MSGBOX"Leaders:",bigstr,"Ok","");
        return 
1
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)