Hello!
I'm trying to load JSON from a file, but I'm getting an error. Anyone any help?
PHP Code:
char path[PLATFORM_MAX_PATH + 1];
BuildPath(Path_SM, path, sizeof(path), "data/match.json");
PrintToServer("FileExists %d", FileExists(path));
JSONObject data = JSONObject.FromFile(path);
Error:
PHP Code:
"[RIPEXT] Invalid JSON in line -1, column -1: unable to
open addons/sourcemod/data/match.json: No such file or directory"
PrintToServer("FileExists %d", FileExists(path)); <- This prints "FileExists: 1"
File:
PHP Code:
{
"map": "de_dust2",
"uuid": "awawras4aw4as4sa"
}
EDIT: Apparently when I add the absolute path of the JSON file to "JSONObject data = JSONObject.FromFile(path);" it works but not with the Path_SM