PLUGIN_META plugin
Plugin hooks and methods
Summary
Hooks
GetAuthor(PLUGIN_META)shared
Returns the plugin's author.
GetBaseDir(PLUGIN_META)shared
Returns the Lua directory the plugin was loaded from.
GetCRC(PLUGIN_META)shared
Returns the CRC of a single-file plugin's path.
Returns the plugin's description.
Returns the plugin's hook order.
GetName(PLUGIN_META)shared
Returns the plugin's name.
GetVersion(PLUGIN_META)shared
Returns the plugin's version.
Returns whether the plugin is a single Lua file rather than a folder.
Register(PLUGIN_META)shared
Registers the plugin.
Makes the plugin available as a global variable, so its hooks can be defined as
Alias:Hook.Functions
__tostring(PLUGIN_META)shared
Converts the plugin to a string of the form
Plugin [name].Hooks
PLUGIN_META.GetAuthor(PLUGIN_META)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:111Returns the plugin's author.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- String The author;
'Unknown'by default
PLUGIN_META.GetBaseDir(PLUGIN_META)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:90Returns the Lua directory the plugin was loaded from.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- String The plugin's
pluginfolder, or the path of a single-file plugin
Returns the CRC of a single-file plugin's path.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- String The path CRC, or
nilfor folder plugins
PLUGIN_META.GetDescription(PLUGIN_META)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:83Returns the plugin's description.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- String The description
PLUGIN_META.GetHookOrder(PLUGIN_META)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:97Returns the plugin's hook order.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- Number The hook order;
0by default
Returns the plugin's name.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- String The name, as set in
plugin.ini
PLUGIN_META.GetVersion(PLUGIN_META)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:104Returns the plugin's version.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- Number The version;
1.0by default
PLUGIN_META.IsSingleFile(PLUGIN_META)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:132Returns whether the plugin is a single Lua file rather than a folder.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- Boolean
truefor single-file plugins,nilotherwise
PLUGIN_META.Register(PLUGIN_META)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:139Registers the plugin.
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
See also
PLUGIN_META.SetGlobalAlias(PLUGIN_META, aliasName)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:75Makes the plugin available as a global variable, so its hooks can be defined as Alias:Hook.
PLUGIN:SetGlobalAlias('cwStorage')
function cwStorage:PlayerSpawn(player) end
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method() - aliasName String Name of the global variable
Functions
PLUGIN_META.__tostring(PLUGIN_META)
shared gamemodes/catwork/gamemode/core/libraries/sh_plugin.lua:146Converts the plugin to a string of the form Plugin [name].
Parameters
- PLUGIN_META Plugin The plugin; passed implicitly when called as
PLUGIN:Method()
Returns
- String The string representation