22.12.2015, 12:59
You can use fread, fseek, and then search the line with strfind function. But this way is not really recommended, because if your log file is so big (let's say, 10MB), your server will lag because it runs in the same thread as the gamemode script and so it will wait until the function finishes searching. It's better to save it to some database like MySQL or another data file plugin (which is threaded) so it can be searched quickly without having lag.
fread is to read the log file, fseek is to seek and jump the position (i.e. you are limiting the search to the last x lines, then you can skip the file reading with this), then strfind is to find the Search string from the fread.
fread is to read the log file, fseek is to seek and jump the position (i.e. you are limiting the search to the last x lines, then you can skip the file reading with this), then strfind is to find the Search string from the fread.