12.12.2014, 23:34
pawn Код:
CMD:log(playerid) {
if ( !IsPlayerAdmin(playerid) )
return SendClientMessage(playerid,-1,"{ff0000}You are not authorized to use this command.");
new read[24], str[128], stroutput[500], arquivoBAN[24];
new File:log = fopen("unban_log.txt", io_read);
while ( fread(log, read) ) {
format(arquivoBAN, "Banidos/%s.ini", read);
if ( fexist(read) ) {
format(str, 128, "Nome do banido: %s - Data de banimento: %s - Admin responsбvel: %s\n", DOF2_GetString(arquivoBAN, "Nome"), DOF2_GetString(arquivoBAN, "Data"), DOF2_GetString(arquivoBAN, "Admin") );
strcat(stroutput, str);
}
}
fclose(log);
return ShowPlayerDialog(playerid, 110, DIALOG_STYLE_MSGBOX, "{00BFFF}Showing Un-Ban Log", stroutput, "Cool", "");
}
O arquivo unban_log.txt deve estar da seguinte maneira:
PHP код:
NOME_DO_BANIDO
NOME_DO_BANIDO2
NOME_DO_BANIDO3