added GetFilename function
This commit is contained in:
parent
0551b46c8b
commit
6ca3edad0c
|
@ -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);
|
||||
|
|
|
@ -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__
|
||||
|
|
Loading…
Reference in New Issue
Block a user