Try this way:
PHP Code:
stock String:GetData()
{
decl String:buffer[PLATFORM_MAX_PATH];
// file location relative to folder .../addons/sourcemod/
BuildPath(Path_SM, buffer, sizeof(buffer), "data.ini");
new Handle:file = OpenFile(buffer, "r");
if(file)
{
// Reads an opened file one line at a time into specified buffer
ReadFileLine(file, buffer, sizeof(buffer));
// Print out contents of first line on the server
PrintToServer("First line in file:\n%s", buffer);
CloseHandle(file);
return buffer;
}
else PrintToServer("Unable to open file \"%s\"", buffer);
buffer[0] = 0;
return buffer;
}
__________________