cityrp.plugin
Revamped plugin system with legacy support, adapted from Helix.
Functions
cityrp.plugin.RunLoadData()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Runs the LoadData and PostLoadData hooks for the gamemode, schema, and plugins. Any plugins that error during the
hook will have their SaveData and PostLoadData hooks removed to prevent them from saving junk data.
hook.SafeRun(name, ...)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Runs the given hook in a protected call so that the calling function will continue executing even if any errors occur
while running the hook. This function is much more expensive to call than hook.Run, so you should avoid using it unless
you absolutely need to avoid errors from stopping the execution of your function.
Parameters
-
name
string
Name of the hook to run
-
...
Arguments to pass to the hook functions
Returns
-
table
Table of error data if an error occurred while running
-
...
Any arguments returned by the hook functions
Example Usage
local errors, bCanSpray = hook.SafeRun("PlayerSpray", Entity(1))
if (!errors) then
-- do stuff with bCanSpray
else
PrintTable(errors)
end
Tables
PLUGIN
View source »Plugin metadata and core helpers.
Fields
-
folder
string
Path to the plugin folder (set by core loader)
-
plugin
PLUGIN or nil
Parent plugin table if nested
-
uniqueID
string
Unique plugin identifier (set by core loader)
-
name
string
Human-readable plugin name
-
description
string
Plugin description
-
author
string
Plugin author
-
loading
boolean
True while plugin files are being included
-
logger
Logger or nil
Cached logger instance (see cityrp.logging)
-
PLUGIN
fun(self:
): PostLoadData nil Optional: runs after
LoadData
-
PLUGIN
fun(self:
): PostLoadData nil Optional: runs after
LoadData
-
PLUGIN
fun(self:
): PostLoadData nil Optional: runs after
LoadData
-
PLUGIN
fun(self:
): PostLoadData nil Optional: runs after
LoadData
-
PLUGIN
fun(self:
): PostLoadData nil Optional: runs after
LoadData
-
PLUGIN
fun(self:
): PostLoadData nil Optional: runs after
LoadData
-
PLUGIN
fun(self:
): PostLoadData nil Optional: runs after
LoadData
-
PLUGIN
fun(self:
): PostLoadData nil Optional: runs after
LoadData