added GetFilename function

This commit is contained in:
Borja Ferrer 2005-11-20 00:00:33 +00:00
parent 0551b46c8b
commit 6ca3edad0c
2 changed files with 18 additions and 0 deletions

View File

@ -546,6 +546,23 @@ AMX* get_amxscript(int id, void** code, const char** filename)
return 0;
}
const char* GetFileName(AMX *amx)
{
const char *filename = "";
CPluginMngr::CPlugin *pl = g_plugins.findPluginFast(amx);
if (pl)
{
filename = pl->getName();
} else {
CList<CScript,AMX*>::iterator a = g_loadedscripts.find(amx);
if (a)
filename = (*a).getName();
}
return filename;
}
const char* get_amxscriptname(AMX* amx)
{
CList<CScript, AMX*>::iterator a = g_loadedscripts.find(amx);

View File

@ -75,5 +75,6 @@ int CheckModules(AMX *amx, char error[128]);
const char *StrCaseStr(const char *as, const char *bs);
void DisableDebugHandler(AMX *amx);
void EnableDebugHandler(AMX *amx);
const char* GetFileName(AMX *amx);
#endif // __MODULES_H__