Quote:
Originally Posted by Hennesy
Hi everyone.
Who can help, need to read configs / rules.txt file
And display in the chat every line that is in the file
|
Code:
new String:g_sFilePath[PLATFORM_MAX_PATH];
BuildPath(Path_SM, g_sFilePath, sizeof(g_sFilePath), "configs/rules.txt"); // this is the csgo/addons/sourcemod/configs/rules.txt
new Handle:fileHandle = OpenFile( g_sFilePath, "r" );
new String:fileLine[256];
while( !IsEndOfFile( fileHandle ) && ReadFileLine( fileHandle, fileLine, sizeof( fileLine ) ) )
{
TrimString( fileLine );
PrintToChatAll(fileLine);
}
CloseHandle( fileHandle );
should do the trick
__________________