set_module_filter
- Синтаксис
-
native set_module_filter(const handler[]);
Переменная | Описание |
---|---|
Нет агрументов |
- Описание
- Sets a module/library filter, letting the plugin intercept and handle an automatic module requirement.
- Пометка
-
This has to be used inside the plugin_native() forward, otherwise it has no effect.
- Пометка
-
This is useful for creating plugins that can dynamically decide which modules or features to use at runtime, often necessary for cross-mod plugins. It allows to deploy a single version of the plugin instead of compiling multiple versions for each use-case.
- Пометка
-
For a list of possible libtypes see the LibType enum in amxconst.inc
- Пометка
-
The handler will be called in the following manner: public module_filter(const library[], LibType:type) library - Shortname of library or class that is required libtrype - Type of requirement being checked (library/module or class)
- Пометка
-
The handler should return PLUGIN_CONTINUE to let the error through the filter (which will result in the plugin failing to load), or PLUGIN_HANDLED to imply that load can continue without the module.
- Пометка
-
Errors occuring inside the handler will not be filtered and cause the plugin to fail load as if the handler returned PLUGIN_CONTINUE.
- Возвращает
- 0 on success, -1 if filtering is not available, -2 if handler could not be found.