Class PLUGIN.worldprops
World Props Module
Class Overview
Methods
| PLUGIN.worldprops:SpawnProp(data) | Spawn a world prop. |
| PLUGIN.worldprops:LoadProps() | Loads the props from either the current map file or the legacy file. |
| PLUGIN.worldprops:SaveProps() | Saves the props to the prop file. |
| PLUGIN.worldprops:IsWorldProp(prop) | Checks if a given prop is a world prop. |
| PLUGIN.worldprops:Command(ply, args) | Command handler for /worldprops. |
Core Methods
| PLUGIN.worldprops:New(name[, author]) | Create a new plugin. |
| PLUGIN.worldprops:CallAsHook(name, ...) | Call the hooks of this plugin. |
| PLUGIN.worldprops:Call(name, ...) | Call the hooks of this plugin, ignoring any output. |
| PLUGIN.worldprops:Hook(name, func) | Adds a hook function to the plugin. |
| PLUGIN.worldprops:AddHook(name, func) | Adds a hook function to the plugin, and also registers the hook with hook.Add |
| PLUGIN.worldprops:Enable() | Enable the plugin. |
| PLUGIN.worldprops:Disable() | Disable the plugin. |
| PLUGIN.worldprops:Enabled() | Get if the plugin is enabled. |
| PLUGIN.worldprops:IsValid() | Checks if the plugin is valid (currently checks enabled status) |
| PLUGIN.worldprops:Register([name=self.name]) | Registers the plugin. |
Data Methods
| PLUGIN.worldprops:CreateFolder(fullPath) | Create a folder, along with any intermedate folders. |
| PLUGIN.worldprops:DataFolder() | Gets the data folder for this plugin. |
| PLUGIN.worldprops:CreateDataFolder() | Creates this plugin's data folder. |
| PLUGIN.worldprops:DataFile(name) | Gets the path to a data file for this plugin. |
| PLUGIN.worldprops:MapFolder() | Gets the data folder for this plugin on the current map. |
| PLUGIN.worldprops:CreateMapFolder() | Creates this plugin's data folder for the current map. |
| PLUGIN.worldprops:MapFile(name) | Gets the path to a map file for this plugin. |
| PLUGIN.worldprops:OpenDataFile(name[, mode=r]) | Gets the file class for the given file. |
| PLUGIN.worldprops:OpenMapFile(name[, mode=r]) | Gets the file class for the given file. |
Abstracted Data Methods
| PLUGIN.worldprops:ReadDataFile(name) | Reads a given data file. |
| PLUGIN.worldprops:WriteDataFile(name, contents) | Writes a given data file. |
| PLUGIN.worldprops:ReadMapFile(name) | Reads a given data file. |
| PLUGIN.worldprops:WriteMapFile(name, contents) | Writes a given data file. |
- PLUGIN.worldprops:SpawnProp(data)
-
Spawn a world prop.
Parameters:
- data tab Data table containing model path, position, angle, colour and material.
Returns:
-
table
Data table above, with added data.ent entry for the created entity.
- PLUGIN.worldprops:LoadProps()
- Loads the props from either the current map file or the legacy file.
- PLUGIN.worldprops:SaveProps()
- Saves the props to the prop file.
- PLUGIN.worldprops:IsWorldProp(prop)
-
Checks if a given prop is a world prop.
Parameters:
- prop Entity Entity to check.
Returns:
-
bool
If the entity is a world prop.
- PLUGIN.worldprops:Command(ply, args)
-
Command handler for /worldprops.
Parameters:
- ply Player Player calling the command.
- args tab Arguments.
- PLUGIN.worldprops:New(name[, author])
-
Create a new plugin.
Parameters:
Returns:
Inhereted from:
- PLUGIN.worldprops:CallAsHook(name, ...)
-
Call the hooks of this plugin.
Parameters:
- name string Name of the hook to call.
- ... vararg Data to pass to the hook function.
Returns:
-
vararg
Returns from the called functions.
Inhereted from:
- PLUGIN.worldprops:Call(name, ...)
-
Call the hooks of this plugin, ignoring any output.
Parameters:
- name string Name of the hook
- ... vararg Data to pass to the hook function.
Returns:
-
vararg
Returns from the called functions.
Inhereted from:
See also:
- PLUGIN.worldprops:Hook(name, func)
-
Adds a hook function to the plugin.
Parameters:
- name string Hook name.
- func func Function to add.
Returns:
Inhereted from:
- PLUGIN.worldprops:AddHook(name, func)
-
Adds a hook function to the plugin, and also registers the hook with hook.Add
Parameters:
- name string Hook name.
- func func Function to add.
Returns:
Inhereted from:
- PLUGIN.worldprops:Enable()
-
Enable the plugin.
Returns:
Inhereted from:
- PLUGIN.worldprops:Disable()
-
Disable the plugin.
Returns:
Inhereted from:
- PLUGIN.worldprops:Enabled()
-
Get if the plugin is enabled.
Returns:
-
bool
Inhereted from:
- PLUGIN.worldprops:IsValid()
-
Checks if the plugin is valid (currently checks enabled status)
Returns:
-
bool
Inhereted from:
See also:
- PLUGIN.worldprops:Register([name=self.name])
-
Registers the plugin.
Parameters:
- name string Name to register the plugin with, if not already defined. (default self.name)
Inhereted from:
- PLUGIN.worldprops:CreateFolder(fullPath)
-
Create a folder, along with any intermedate folders.
Parameters:
- fullPath string Folder path.
Returns:
Inhereted from:
- PLUGIN.worldprops:DataFolder()
-
Gets the data folder for this plugin.
Returns:
Inhereted from:
- PLUGIN.worldprops:CreateDataFolder()
-
Creates this plugin's data folder.
Returns:
Inhereted from:
- PLUGIN.worldprops:DataFile(name)
-
Gets the path to a data file for this plugin.
Parameters:
- name string File name.
Returns:
-
string
Full path.
Inhereted from:
- PLUGIN.worldprops:MapFolder()
-
Gets the data folder for this plugin on the current map.
Returns:
Inhereted from:
- PLUGIN.worldprops:CreateMapFolder()
-
Creates this plugin's data folder for the current map.
Returns:
Inhereted from:
- PLUGIN.worldprops:MapFile(name)
-
Gets the path to a map file for this plugin.
Parameters:
- name string File name.
Returns:
-
string
Full path.
Inhereted from:
- PLUGIN.worldprops:OpenDataFile(name[, mode=r])
-
Gets the file class for the given file.
Parameters:
Returns:
-
file_class
Inhereted from:
See also:
- PLUGIN.worldprops:OpenMapFile(name[, mode=r])
-
Gets the file class for the given file.
Parameters:
Returns:
-
file_class
Inhereted from:
See also:
- PLUGIN.worldprops:ReadDataFile(name)
-
Reads a given data file.
Parameters:
- name string File name.
Returns:
-
string
File contents.
Inhereted from:
- PLUGIN.worldprops:WriteDataFile(name, contents)
-
Writes a given data file.
Parameters:
Returns:
Inhereted from:
- PLUGIN.worldprops:ReadMapFile(name)
-
Reads a given data file.
Parameters:
- name string File name.
Returns:
-
string
File contents.
Inhereted from:
- PLUGIN.worldprops:WriteMapFile(name, contents)
-
Writes a given data file.
Parameters:
Returns:
Inhereted from: