21.02.2015, 21:51
(
Последний раз редактировалось xeeZ; 06.03.2015 в 17:10.
)
I think I mentioned this in some other suggestions topic a couple of versions back:
It would be great if there was a way to get the path to the .amx file from which the AMX has been loaded. This is extremely useful for plugins that need to load debug info from .amx files.
The current method that I'm using is looping through all .amx files in the gamemodes and filterscripts directories and loading them and seeing if the headers are identical. But this is kind of ugly, plus files outside of standard folders won't get loaded (there's a workaround though but it requires additional user effort).
I see 3 possible solutions (not necessarily mutually exclusive):
1) Add support for an AmxLoadEx() function which would be similar to AmxLoad() but would take an additional "const char *path" parameter.
2) Export a new plugin API for retrieving the path via ppPluginData, something like "const char *GetAmxPath(AMX *amx)".
3) Export a native function - some scripts could benefit from this (e.g. introspect.inc by Slice) and it would still be callable from plugins (although not quite as easily).
Thanks!
It would be great if there was a way to get the path to the .amx file from which the AMX has been loaded. This is extremely useful for plugins that need to load debug info from .amx files.
The current method that I'm using is looping through all .amx files in the gamemodes and filterscripts directories and loading them and seeing if the headers are identical. But this is kind of ugly, plus files outside of standard folders won't get loaded (there's a workaround though but it requires additional user effort).
I see 3 possible solutions (not necessarily mutually exclusive):
1) Add support for an AmxLoadEx() function which would be similar to AmxLoad() but would take an additional "const char *path" parameter.
2) Export a new plugin API for retrieving the path via ppPluginData, something like "const char *GetAmxPath(AMX *amx)".
3) Export a native function - some scripts could benefit from this (e.g. introspect.inc by Slice) and it would still be callable from plugins (although not quite as easily).
Thanks!