Here ->
PHP Code:
stock CheckForString(const szDir[16], const szFile[16], const szString[])
{
new szLocalDir[32];
get_localinfo("amx_basedir", szLocalDir, charsmax(szLocalDir));
new szPath[64];
formatex(szPath, charsmax(szPath), "%s/%s/%s", szLocalDir, szDir, szFile);
new iFile = fopen(szPath);
if(!iFile)
return 0;
new szBuffer[128];
while(!feof(iFile))
{
fgets(iFile, szBuffer, charsmax(szBuffer));
if(!szBuffer[0])
continue;
if(containi(szBuffer, szString) != -1)
{
fclose(iFile);
return 1;
}
}
fclose(iFile);
return 0;
}
Just use CheckForString("logs", "somefile.log", "searched_string") , returns 0 if file not exists or string wasn't found else returns 1
__________________