02.08.2011, 02:11
(
Последний раз редактировалось Kingunit; 05.08.2011 в 13:53.
)
<fixed>
format(string, sizeof(string), "%s has been kicked by Admin %s. Reason: %s", playername, adminname, reason);
AdminLog(string);
stock AdminLog(string[])
{
new LogString[150], YEAR_string[5], Year, Month, Day, Hour, Minute, Second;
new File:AdminLog = fopen("admin_log.txt", io_append);
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
format(YEAR_string, sizeof(YEAR_string), "%d", Year);
strdel(YEAR_string, 0, 2);
format(LogString, sizeof(LogString), "[%d/%d/%s | %d:%d] %s", Day, Month, YEAR_string, Hour, Minute, string);
fwrite(AdminLog, LogString);
fwrite(AdminLog, "\r\n");
return fclose(AdminLog);
}
stock SLog(stringtext1[],stringtext2[],name[])
{
new INI:file = INI_Open(name);
INI_WriteString(file,stringtext1,stringtext2);
INI_Close(file);
return 1;
}
//That stock will write "stringtext1 = stringtext2" inside "name" file.
//f.e:
stock STimeDate()
{
new Times[2],Dates[3],string[64];
gettime(Times[0],Times[1]);
getdate(Dates[0],Dates[1],Dates[2]);
CostumFormat(string,"%d/%d/%d - %d:%d",Dates[2],Dates[1],Dates[0],Times[0],Times[1]);
return string;
}
//Somewhere
SLog(STimeDate(),"blahblahblah","Testfile.ini")
//That code will write "day/month/year - hour:minute = blahblahblah" inside "Testfile.ini" file.