06.07.2015, 11:09
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);
}