Quote:
Originally Posted by pr0mers
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" );
decl String:fileLine[256];
while( !IsEndOfFile( fileHandle ) && ReadFileLine( fileHandle, fileLine, sizeof( fileLine ) ) )
{
TrimString( fileLine );
PrintToChatAll(fileLine);
}
CloseHandle( fileHandle );
should do the trick
|
need new syntax.
PHP Code:
static char g_sFilePath[PLATFORM_MAX_PATH], fileLine[256];
BuildPath(Path_SM, g_sFilePath, sizeof(g_sFilePath), "configs/rules.txt");
Handle fileHandle = OpenFile( g_sFilePath, "r" );
while(!IsEndOfFile(fileHandle) && ReadFileLine(fileHandle, fileLine, sizeof(fileLine)))
{
TrimString(fileLine);
PrintToChatAll(fileLine);
}
delete fileHandle;
I'll go check
__________________