pawn Код:
CMD:orgs(playerid) {
new Str[64], String[2048], iD = 0xFFFF;
for(new i; i != MaxOrgs; ++i) { //Altera para o Mбximo de Orgs.
format(Str, 64, #FILE"/%s.ini", NameOrgs[i]); //#FILE = Local onde armazena os lideres, NameOrgs = Nome das orgs por ID.
format(Str, 32, "%s", DOF2_GetString(Str, "LIDER")); //Altera para a clausula do seu sistema
if(!strcmp(Str, "Nenhum")) Str = "Ninguйm"; //Altera para a clausula que aponta nenhum membro
else iD = ReturnUser(Str);
if(iD != 0xFFFF && IsPlayerConnected(iD)) format(String, 2048, "%s{C2A2DA} %d >> %s: %s - {00D900}Online\n", String, i, NameOrgs[i], Str); //Name
else format(String, 2048, "%s{C2A2DA} %d >> %s: %s - {AA3333}Offline\n", String, i, NameOrgs[i], Str);
}
return ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_MSGBOX, "Orgs", String, "Fechar", #);
}
ReturnUser(text[]) {
new len = strlen(text[pos]), name[21];
for (new i; i != MAX_PLAYERS; ++i) {
if(IsPlayerConnected(i)) {
GetPlayerName(i, name, 20);
if(!strcmp(name, text[pos], true, len)) return i;
}
}
return 1;
}