exampleplugin.sh_plugin
(no description)
Functions
ExampleFunction()
View source »Example: A simple function to demonstrate how to define a function within the plugin. This function is also a hook, and can be called elsewhere via hook.Run("ExampleHook", ...).
LoadData()
View source »Optional: Called by the server after map load (and potentially at other times) to load plugin data. Use self:GetData(default) to load your plugin's data from the database into a runtime variable. If no data is found, it returns the 'default' value provided. Also called manually in OnLoaded in this example for initial load.
OnLoaded()
View source »Optional: Called after the plugin and all its included files (both automatic and manual) are loaded. Good place for initialization logic that depends on other plugin files being loaded.
PlayerInitialSpawn(ply)
View source »Example Hook: Called when a player initially spawns into the server.
Parameters
-
ply
Player
The player who spawned.
SaveData()
View source »Optional: Called periodically by the server (defined by core gamemode settings) to save plugin data. Use self:SetData(data) to save your plugin's current runtime data to the database. The 'data' argument should be a table. It will be JSON-encoded for storage.