Quote:
Originally Posted by asherkin
|
I did as you advised, but the server still crashes, the hook works, but the original function with the new parameter is not called. what should I do? I just need to replace the file name with another file name and call the open function so that it continues working
PHP Code:
FileHandle_t SamplePlugin::Hook_Open(const char *pFileName, const char *pOptions, const char *pathID) {
if(strncmp(pFileName, "materials/headshot1.vtf", strlen("materials/headshot1.vtf")) == 0) {
META_LOG(g_PLAPI, "yeaaa opening headshot file \"%s\",pOptions \"%s\",pathID \"%s\".", pFileName, pOptions, pathID);
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, NULL, &IBaseFileSystem::Open, ("materials/headshot2.vtf", pOptions, pathID));
}
RETURN_META_VALUE(MRES_IGNORED, false);
}