27.03.2011, 00:52
Make a folder in your scriptfiles folder and name it something, like your server short form name for example, or Plik as I see it is the name in your code.
Now, make a text file in scriptfiles/Plik with a .txt extension at the end, like KickLog.txt
Next, type SaveToFile("KickLog",string); under your kick command, as this is the example for now (You can change it up if you want)
Now when the next person gets kicked, it will save a log of it in scriptfiles/Plik/KickLog.txt
pawn Код:
// Top of your script
#define SAVE_LOGS
// Bottom of your script:
forward SaveToFile(filename[],text[]);
public SaveToFile(filename[],text[])
{
#if defined SAVE_LOGS
new File:Plik, filepath[256], string[256], year,month,day, hour,minute,second;
getdate(year,month,day); gettime(hour,minute,second);
format(filepath,sizeof(filepath),"ladmin/logs/%s.txt",filename);
Plik = fopen(filepath,io_append);
format(string,sizeof(string),"[%d.%d.%d %d:%d:%d] %s\r\n",day,month,year,hour,minute,second,text);
fwrite(Plik,string);
fclose(Plik);
#endif
return 1;
}
Next, type SaveToFile("KickLog",string); under your kick command, as this is the example for now (You can change it up if you want)
Now when the next person gets kicked, it will save a log of it in scriptfiles/Plik/KickLog.txt