Ban list for Y_ini
#6

Well if you are going to use Time and Reason as keys, I would suggest using splitting the file into sections(y_ini has support for that) where each section would be named after the player.


pawn Код:
stock BanPlayer(playerid, reason[])
{
    new INI:file = INI_Open("bans.ini"),
          name[MAX_PLAYER_NAME],
          string[64];
 
    GetPlayerName(playerid, name, sizeof(name));
    INI_SetTag(ini, name);
    INI_WriteString(ini, "Name", name);
    INI_WriteString(ini, "Reason", reason);
    // You can use a simple timestamp, but I assume you will want a understable date format
    new year, month, day, hour, minute, second;
    getdate(year, month, day);
    gettime(hour, minute, second);
    format(string, sizeof(string), "%d.%d.%d %d:%d:%d", year, month, day, hour, minute, second);
    INI_WriteString(ini, "Date", string);
    INI_Close(ini);
}
Reply


Messages In This Thread
Ban list for Y_ini - by bigboy81 - 06.07.2015, 10:26
Re: Ban list for Y_ini - by dusk - 06.07.2015, 10:39
Re: Ban list for Y_ini - by bigboy81 - 06.07.2015, 10:44
Re: Ban list for Y_ini - by dusk - 06.07.2015, 10:46
Re: Ban list for Y_ini - by bigboy81 - 06.07.2015, 10:49
Re: Ban list for Y_ini - by dusk - 06.07.2015, 11:09
Re: Ban list for Y_ini - by bigboy81 - 06.07.2015, 11:22
Re: Ban list for Y_ini - by dusk - 06.07.2015, 11:55
Re: Ban list for Y_ini - by bigboy81 - 06.07.2015, 12:17
Re: Ban list for Y_ini - by dusk - 06.07.2015, 12:21

Forum Jump:


Users browsing this thread: 1 Guest(s)