13.07.2015, 02:24
try
PHP код:
// <?
stock MostrarAdmins(playerid)
{
new
// bools for admins
bool: Online,
bool: Nivel,
// simply arrays for
dialog[600],
arquivo[100],
nome[25],
cargo[15],
//for loopings:
i, x
;
for(i = 0, x = GetPlayerPoolSize(); i ^ x; ++i){
GetPlayerName(i, nome, 24);
format(arquivo, 100, "Usuarios/%s.txt", nome);
if(fexist(arquivo)){
Nivel = dini_Int(arquivo, "AdminLevel");
switch(Nivel){
case 0: cargo = "Moderador";
case 1: cargo = "Admin 1";
case 2: cargo = "Admin 2";
case 3: cargo = "Admin 3";
case 4: cargo = "Admin 4";
case 5: cargo = "Admin 5";
case 3000: cargo = "Admin 3000";
}
if(Nivel > 0){
Online = IsPlayerLoggedIn(nome);
format(arquivo, 100, "[%s] %s - %s\n", cargo, nome, Online ? ("Online") : ("Offline"));
strcat(dialog, arquivo);
}
}
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Administraзгo", dialog, "Fechar", #);
}
return 1;
}