FrameworkZ 4.4.2
Provides a framework for Project Zomboid with various systems.
Loading...
Searching...
No Matches
PLAYER Class Reference

Player class for FrameworkZ. More...

Public Member Functions

mixed Destroy ()
 Destroys the player object.
 
table GetStoredData ()
 Gets the stored player mod data table. Used internally. Do not use this unless you know what you are doing. Updating data on the mod data will cause inconsistencies between the mod data and the FrameworkZ player object.
 
void GetWhitelists ()
 
string Initialize ()
 Initializes the player object.
 
void InitializeDefaultFactionWhitelists ()
 
void IsWhitelisted (factionID)
 
integer PlayLocalSound (soundName)
 Plays a sound for the player that only they can hear.
 
boolean Save (shouldTransmit)
 Saves the player's data.
 
void SetWhitelisted (factionID, whitelisted)
 
void StopSound (soundNameOrID)
 Stops a sound for the player.
 
void ValidatePlayerData ()
 

Data Fields

PLAYER __index
 

Detailed Description

Player class for FrameworkZ.

Definition at line 86 of file Players.lua.

Member Function Documentation

◆ Destroy()

mixed Destroy ( )

Destroys the player object.

Returns
mixed of boolean Whether or not the player was successfully destroyed and string The message on success or failure.

◆ GetStoredData()

table GetStoredData ( )

Gets the stored player mod data table. Used internally. Do not use this unless you know what you are doing. Updating data on the mod data will cause inconsistencies between the mod data and the FrameworkZ player object.

Returns
table The stored player mod data table.

◆ GetWhitelists()

void GetWhitelists ( )

◆ Initialize()

string Initialize ( )

Initializes the player object.

Returns
string The username of the player.

◆ InitializeDefaultFactionWhitelists()

void InitializeDefaultFactionWhitelists ( )

◆ IsWhitelisted()

void IsWhitelisted ( factionID )

◆ PlayLocalSound()

integer PlayLocalSound ( soundName )

Plays a sound for the player that only they can hear.

Parameters
soundNamestring The name of the sound to play.
Returns
integer The sound's ID.

◆ Save()

boolean Save ( shouldTransmit )

Saves the player's data.

Parameters
shouldTransmitboolean (Optional) Whether or not to transmit the player's data to the server.
Returns
boolean Whether or not the player was successfully saved.
Todo
Test if localized variable (playerData) maintains referential integrity for transmitModData() to work on it.

◆ SetWhitelisted()

void SetWhitelisted ( factionID ,
whitelisted  )

◆ StopSound()

void StopSound ( soundNameOrID )

Stops a sound for the player.

Parameters
soundNameOrIDmixed of string or integer The name or ID of the sound to stop.

◆ ValidatePlayerData()

void ValidatePlayerData ( )

Field Documentation

◆ __index

PLAYER __index

Definition at line 88 of file Players.lua.


The documentation for this class was generated from the following file: