17.06.2015, 20:23
Hello! I have a problem to /leaders, show only a leader .. help me
PHP код:
if(strcmp(cmd, "/leaders", true) == 0 || strcmp(cmd, "/lideri", true) == 0)
{
new count = 0;
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pLeader] >= 1)
{
new idtext[100];
if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1) { format(idtext,sizeof(idtext),"{0000FF}Police Departament{FFFFFF}"); }
else if(PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pLeader] == 2) { format(idtext,sizeof(idtext),"{0000FF}National Guard{FFFFFF}"); }
else if(PlayerInfo[i][pMember] == 3 || PlayerInfo[i][pLeader] == 3) { format(idtext,sizeof(idtext),"{FF6347}Paramedic{FFFFFF}"); }
else if(PlayerInfo[i][pMember] == 4 || PlayerInfo[i][pLeader] == 4) { format(idtext,sizeof(idtext),"{373837}The Russian Mafia{FFFFFF}"); }
else if(PlayerInfo[i][pMember] == 5 || PlayerInfo[i][pLeader] == 5) { format(idtext,sizeof(idtext),"{1C7D19}Grove Street{FFFFFF}"); }
else if(PlayerInfo[i][pMember] == 6 || PlayerInfo[i][pLeader] == 6) { format(idtext,sizeof(idtext),"{F2B407}Los Vagos{FFFFFF}"); }
else if(PlayerInfo[i][pMember] == 7 || PlayerInfo[i][pLeader] == 7) { format(idtext,sizeof(idtext),"{DDA0DD}News Reporter{FFFFFF}"); }
else if(PlayerInfo[i][pMember] == 8 || PlayerInfo[i][pLeader] == 8) { format(idtext,sizeof(idtext),"{FFFF00}Taxi Cab Company{FFFFFF}"); }
else if(PlayerInfo[i][pMember] == 9 || 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(i, giveplayer, sizeof(giveplayer));
count ++;
new string2[1024];
if(count == 0)
{
format(string2, sizeof(string2), "{FFFFFF}• Leader %s: %s[ID: %d] | Numar de telefon: {FFEA00}%d\n",idtext, giveplayer, i, PlayerInfo[i][pPhoneNumber]);
}
else if(count > 0)
{
format(string2, sizeof(string2), "%s{FFFFFF}• Leader %s: %s[ID: %d] | Numar de telefon: {FFEA00}%d\n{FFFFFF}",string2,idtext, giveplayer, i, PlayerInfo[i][pPhoneNumber]);
}
ShowPlayerDialog(playerid, 77, DIALOG_STYLE_MSGBOX, "Leaders:", string2, "Ok", "");
}
}
if(count == 0) return SCM(playerid, -1, "* Nu sunt lideri online!");
}
return 1;
}