diff --git a/amxmodx/sdk/amxxmodule.cpp b/amxmodx/sdk/amxxmodule.cpp index d5d49b62..2db3f481 100755 --- a/amxmodx/sdk/amxxmodule.cpp +++ b/amxmodx/sdk/amxxmodule.cpp @@ -2421,9 +2421,6 @@ C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, /************* AMXX Stuff *************/ -// *** Types *** -typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); - // *** Globals *** // Module info static amxx_module_info_s g_ModuleInfo = @@ -2502,6 +2499,7 @@ PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags; PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; PFN_FORMAT g_fn_Format; PFN_REGISTERFUNCTION g_fn_RegisterFunction; +PFN_REQ_FNPTR g_fn_RequestFunction; // *** Exports *** C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) @@ -2539,6 +2537,8 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) if (!reqFnptrFunc) return AMXX_PARAM; + g_fn_RequestFunction = reqFnptrFunc; + // Req all known functions // Misc REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME); diff --git a/amxmodx/sdk/amxxmodule.h b/amxmodx/sdk/amxxmodule.h index 090df9ff..2d5dcee0 100755 --- a/amxmodx/sdk/amxxmodule.h +++ b/amxmodx/sdk/amxxmodule.h @@ -1883,6 +1883,9 @@ void FN_AMXX_DETACH(void); void FN_AMXX_PLUGINSLOADED(void); #endif // FN_AMXX_PLUGINSLOADED +// *** Types *** +typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); + // ***** Module funcs stuff ***** enum ForwardExecType { @@ -2036,6 +2039,7 @@ extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict; extern PFN_FORMAT g_fn_Format; extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam; extern PFN_REGISTERFUNCTION g_fn_RegisterFunction; +extern PFN_REQ_FNPTR g_fn_RequestFunction; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2092,6 +2096,7 @@ int MF_GetPlayerFlags (int id) { } edict_t* MF_GetPlayerEdict (int id) { } const char * MF_Format (const char *fmt, ...) { } void MF_RegisterFunction (void *pfn, const char *description) { } +void * MF_RequestFunction (const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2154,6 +2159,7 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_GetPlayerEdict g_fn_GetPlayerEdict #define MF_Format g_fn_Format #define MF_RegisterFunction g_fn_RegisterFunction +#define MF_RequestFunction g_fn_RequestFunction; /*** Memory ***/ void *operator new(size_t reportedSize);