24.10.2014, 21:14
Estava tentando fazer um comando /orgs para o gm (Sim й editado '-') e entгo procurando no ****** achei esse tуpico: https://sampforum.blast.hk/showthread.php?tid=378135 fui seguindo o modelo e mudei o lнder para Pleader mas ao entrar no jogo e usar o /orgs sу aparece o nome se o lнder da org estiver online, ou seja, se nгo tiver nenhum lнder ou o lнder estiver offline ele nгo aparece no /orgs, como resolvo isso?
Код:
if(strcmp(cmd, "/organizacoes", true) == 0 || strcmp(cmd, "/orgs", true) == 0) { new odialog[1000]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pLeader] == 1) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Policia Militar (ID:1) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 2) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Swat (ID:2) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 3) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Forзas Armadas (ID:3) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 4) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Mйdicos (ID:4) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 5) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Ballas (ID:5) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 6) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Groove Stret (ID:6) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 7) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Prefeitura (ID:7) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 8) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Hitmans (ID:8) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 9) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Reporter (ID:9) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 10) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Lowrider (ID:10) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 11) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "------- (ID:11) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 12) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Los Santos Vagos (ID:12) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 13) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Asphalt King's (ID:13) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 14) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Policia Militar (ID:14) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 15) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Aztecas (ID:15) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 16) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Triads (ID:16) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 17) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Yakuza (ID:17) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 18) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Drifters (ID:18) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 19) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Comando Vermelho (ID:19) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 20) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "PCC (ID:20) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 21) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Swat (ID:21) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } if(PlayerInfo[i][pLeader] == 22) { GetPlayerName(i,sendername,sizeof(sendername)); format(string, sizeof(string), "Al-Qaeda (ID:22) | Lider: %s[ID:%d]", sendername, i); strcat(odialog,string); } ShowPlayerDialog(playerid,2563,DIALOG_STYLE_MSGBOX,"Organizaзхes & Lideres",odialog,"FECHAR",""); } } return 1; }