Character class for FrameworkZ.
More...
Character class for FrameworkZ.
Definition at line 147 of file Characters.lua.
◆ Destroy()
Destroy a character. This will remove the character from the list of characters and is usually called after a player has disconnected.
◆ GetInventory()
Get the character's inventory object.
- Returns
- table The character's inventory object.
◆ GetName()
◆ GiveItem()
Give a character an item.
- Parameters
-
uniqueID | string The ID of the item to give. |
- Returns
- boolean Whether or not the item was successfully given.
◆ GiveItems()
Give a character items by the specified amount.
- Parameters
-
itemID | string The ID of the item to give. |
amount | integer The amount of the item to give. |
◆ Initialize()
Initialize a character.
- Returns
- string username
◆ InitializeDefaultItems()
void InitializeDefaultItems |
( |
| ) |
|
Initialize the default items for a character based on their faction. Called when FZ_CHAR mod data is first created.
◆ IsCitizen()
Checks if a character is a citizen.
- Returns
- boolean Whether or not the character is a citizen.
◆ IsCombine()
Checks if a character is a combine.
- Returns
- boolean Whether or not the character is a combine.
◆ OnLoad()
◆ OnPostLoad()
void OnPostLoad |
( |
firstLoad | | ) |
|
◆ OnPreLoad()
◆ Save()
boolean Save |
( |
shouldTransmit | | ) |
|
Save the character's data from the character object.
- Parameters
-
shouldTransmit | boolean (Optional) Whether or not to transmit the character's data to the server. |
- Returns
- boolean Whether or not the character was successfully saved.
◆ SetAge()
Set the age of the character.
- Parameters
-
age | integer The age of the character. |
◆ SetDescription()
Set the description of the character.
- Parameters
-
description | string The description of the character's appearance. |
◆ SetFaction()
Set the faction of the character.
- Parameters
-
faction | string The ID of the faction to set on the character. |
◆ SetName()
Set the name of the character.
- Parameters
-
name | string The new name for the character. |
◆ TakeItem()
Take an item from a character's inventory.
- Parameters
-
itemID | string The ID of the item to take. |
- Returns
- boolean Whether or not the item was successfully taken.
◆ TakeItemByInstanceID()
Take an item from a character's inventory by its instance ID. Useful for taking a specific item from a stack.
- Parameters
-
itemID | string The ID of the item to take. |
instanceID | integer The instance ID of the item to take. |
- Returns
- boolean Whether or not the item was successfully taken.
◆ ValidateCharacterData()
boolean ValidateCharacterData |
( |
| ) |
|
Validate the character's data.
- Returns
- boolean Whether or not any of the character's new data was initialized.
◆ __index
The documentation for this class was generated from the following file: