The player table structure is the structure of the table called jBlacklist which can be found inside all players that have loaded. The table holds information such as a player's blacklists and network message cooldown. If a player has more than one blacklist of the same type, the one with the longest expire date will be loaded.
Table:
[Blacklists]: [string blacklistType] = number expireDate (The time when the blacklist expires in epoch time) [NetCooldown] = number cooldown (The cooldown is stored as the server's total uptime with 0.5 seconds added to it. If the value is higher than CurTime, the player has a cooldown.)
The blacklist table structure is the structure of the table which can be found in the blacklist result strcuture.
Table:
string STEAMID (The SteamID of the player which the blacklist belongs to) string TYPE (The blacklist type) string REASON (The reason why the blacklist was issued) string ADMIN (The SteamID of the administrator or CONSOLE if it was issued by the console) number DATE (The date when the blacklist was issued in epoch time) number LASTUPDATE (The date when the blacklist was last updated in epoch time) number TIME (The date when the blacklist expires in epoch time)
The blacklist result structure is the structure of the table which will be returned when you use any of the data management functions. If the function would fail to read the requested information, the result will be false and the reason will be the reason of the failure. If the function wouldn't find any of the requested data, the result will be an empty table.
Table:
[number blacklistID]: string STEAMID (The SteamID of the player which the blacklist belongs to) string TYPE (The blacklist type) string REASON (The reason why the blacklist was issued) string ADMIN (The SteamID of the administrator or CONSOLE if it was issued by the console) number DATE (The date when the blacklist was issued in epoch time) number LASTUPDATE (The date when the blacklist was last updated in epoch time) number TIME (The date when the blacklist expires in epoch time)
The blacklist module structure is the structure of the table that is created inside of custom blacklist modules.
Table:
string Name (The name of the blacklist module) boolean Enabled (A boolean if the blacklist is enabled or not) function GetDescription (A function used to get the description of the blacklist type) function GetBlacklistedPhrase (A function used to get the phrase which says the player did something it was blacklisted from doing) function OnIssued (A function which will be called when a blacklist of this type is issued) function OnExpire (A function which will be called when a blacklist of this type expires)
The logging enumerations are global variables that can be used within certain functions.
JBLACKLIST_LOGGINGENUM_ADMIN - Used to log administration events.
JBLACKLIST_LOGGINGENUM_OTHER - Used to log other events.
The notification enumerations are global variables that can be used within certain functions.
JBLACKLIST_NOTIFYENUM_WINDOW - Used to show a notification in a window.
JBLACKLIST_NOTIFYENUM_POPUP - Used to show a notification as a popup in the lower right of the screen.
JBLACKLIST_NOTIFYENUM_CHAT - Used to show a notification in the chat.
Hook Name: | jBlacklist_StartedLoading |
Returns: | Nothing |
Realm: | Shared |
Description | This hook will be called when JBlacklist starts up. |
This hook has no hook parameters.
This hook has no return values.
Hook Name: | jBlacklist_FinishedLoading |
Returns: | Nothing |
Realm: | Shared |
Description | This hook will be called when JBlacklist have finished starting up. |
This hook has no hook parameters.
This hook has no return values.
Hook Name: | jBlacklist_BlacklistRegistered |
Returns: | Nothing |
Realm: | Shared |
Description | This hook will be called when a blacklist module have been loaded into JBlacklist. |
1. moduleTable (table)
- The moduleTable is the table which is created inside custom blacklist modules. (Check blacklist module structure)
This hook has no return values.
Hook Name: | jBlacklist_BlacklistsFinishedLoading |
Returns: | Nothing |
Realm: | Shared |
Description | This hook will be called all blacklist modules have been loaded. |
This hook has no hook parameters.
This hook has no return values.
Hook Name: | jBlacklist_LanguageChanged |
Returns: | Nothing |
Realm: | Shared |
Description | This hook will be called when the language of the addon is changed. |
1. languageName (string)
- The languageName is the name of the language that the addon was changed to.
This hook has no return values.
Hook Name: | jBlacklist_LanguagesFinishedLoading |
Returns: | Nothing |
Realm: | Shared |
Description | This hook will be called when all language modules have finished loading. |
This hook has no hook parameters.
This hook has no return values.
Hook Name: | jBlacklist_InitialPlayerLoaded |
Returns: | Nothing |
Realm: | Server |
Description | This hook will be called the first time a player is loaded. |
1. ply (player)
- The player whose blacklists was loaded.
This hook has no return values.
Hook Name: | jBlacklist_PlayerLoaded |
Returns: | Nothing |
Realm: | Server |
Description | This hook will be called each time a player is loaded/reloaded. |
1. ply (player)
- The player whose blacklists was loaded.
This hook has no return values.
Hook Name: | jBlacklist_DataChange |
Returns: | Nothing |
Realm: | Client |
Description | This hook will be called when a change is made within someones blacklists. |
1. targets (table)
- A table with all the SteamIDs of all affected players.
2. adminID (string)
- The SteamID of the administrator who caused the datachange.
This hook has no return values.
Hook Name: | jBlacklist_BlacklistIssued |
Returns: | Nothing |
Realm: | Server |
Description | This hook will be called when someone issues one or more blacklists. |
1. ply (player)
- The player who issued the blacklists.
2. types (table)
- A table with all the blacklist types as strings.
3. targets (table)
- A table with SteamIDs of all the players that should be blacklisted.
4. blacklistLength (number)
- The length of the blacklists in seconds.
5. reason (string)
- The reason for the blacklists.
6. silent (boolean)
- A boolean if the blacklists were issued silently.
This hook has no return values.
Hook Name: | jBlacklist_BlacklistRemoved |
Returns: | Nothing |
Realm: | Server |
Description | This hook will be called when someone removes a blacklist. |
1. ply (player)
- The player who removed the blacklist.
2. SteamID (string)
- The SteamID of the player whose blacklist were removed.
3. blacklistID (string)
- The ID of the blacklist that was removed.
This hook has no return values.
Hook Name: | jBlacklist_BlacklistModified |
Returns: | Nothing |
Realm: | Server |
Description | This hook will be called when someone modify a blacklist. |
1. ply (player)
- The player who modified the blacklist.
2. SteamID (string)
- The SteamID of the player whose blacklist were modified.
3. blacklistID (string)
- The ID of the blacklist that was modified.
4. blacklistTable (table)
- The blacklist table after it has been modified. (Check blacklist table structure for more information.)
This hook has no return values.
Hook Name: | jBlacklist_BlacklistsErased |
Returns: | Nothing |
Realm: | Server |
Description | This hook will be called when someone erases all blacklists from someone. |
1. ply (player)
- The player who erased the blacklists.
2. SteamID (string)
- The SteamID of the player whose blacklists were erased.
This hook has no return values.
Function Name: | PLAYER:IsBlacklisted( table blacklistTable ) |
Returns: | boolean isBlacklisted |
Realm: | Server |
Description: | This function will return a boolean if a player is blacklisted or not. |
1. blacklistTable (table)
- The blacklistTable is created inside of custom blacklists and is used to identify which blacklist we want to check.
1. isBlacklisted (boolean)
- A boolean if the player is blacklisted from the provided blacklist or not. (true = Blacklisted - false = Not Blacklisted)
Function Name: | jBlacklist.FormatBlacklistTime( number Time) |
Returns: | string formattedTime |
Realm: | Shared |
Description: | This function will return a formatted text of the given time. (Example: 1 hour and 10 minutes) |
1. Time (number)
- The time in seconds that we want to format.
1. formattedString (string)
- The formatted time returned as a string. (Example: 1 hour and 10 minutes)
Function Name: | jBlacklist.RegisterBL( table blacklistTable ) |
Returns: | Nothing |
Realm: | Shared |
Description | This function will load a blacklist-type into the addon. |
1. blacklistTable (table)
- The table holding all the information for the blacklist-type.
This function does not return anything.
Function Name: | jBlacklist.ShowBlacklistedPopup( player ply, table blacklistTbl ) |
Returns: | Nothing |
Realm: | Shared |
Description | This function will display in the lower right corner that the player tried doing something it was blacklisted from doing. |
1. ply (player)
- The player we want to show the message to.
2. blacklistTable (table)
- The table holding all the information for the blacklist-type.
This function does not return anything.
Function Name: | jBlacklist.Log( string type, string title, string message ) |
Returns: | Nothing |
Realm: | Server |
Description | This function is used to log something. |
1. type (string)
- The logging type. (Check logging enums for more information.)
2. title (string)
- The title of the logging message.
3. message (string)
- The message that we want to log.
This function does not return anything.
Function Name: | jBlacklist.Configuration.AddConfig( string identifier, table tbl ) |
Returns: | Nothing |
Realm: | Shared |
Description: | This function will add a new configuration option to the configuration menu. |
1. identifier (string)
- The identifier for the configuration-option and will be used to get it's value, etc.
2. tbl (table)
- The tbl will contain information about the configuration-option. (Check configtable structure)
This function does not return anything.
Function Name: | jBlacklist.Configuration.AddUserconfig( string identifier, table tbl ) |
Returns: | Nothing |
Realm: | Shared |
Description: | This function will add a new configuration option to the configuration menu for usergroups. |
1. identifier (string)
- The identifier for the configuration-option and will be used to get it's value, etc.
2. tbl (table)
- The tbl will contain information about the configuration-option. (Check usergroups-configtable structure)
This function does not return anything.
Function Name: | jBlacklist.Configuration.GetConfigValue( string identifier ) |
Returns: | value configValue |
Realm: | Shared |
Description: | This function is used to get the configuration-value from a configuration-option. |
1. identifier (string)
- The identifier for the configuration-option we want to get.
1. configValue (value)
- The requested configuration-value. (Datatype depends on how it was registered)
Function Name: | jBlacklist.Configuration.GetUsergroupConfigValue( player ply, string identifier ) |
Returns: | value configValue |
Realm: | Shared |
Description: | This function is used to get the configuration-value from a specific player depending on it's usergroup. |
1. identifier (string)
- The identifier for the configuration-option we want to get.
2. ply (player)
- The player we want to get the configuration-value from.
1. configValue (value)
- The requested configuration-value. (Datatype depends on how it was registered)
Function Name: | jBlacklist.RegisterLang( table lang ) |
Returns: | Nothing |
Realm: | Shared |
Description: | This function is used when creating a language to register the language in the addon. |
1. lang (table)
- The language-table we want to register.
This function does not return anything.
Function Name: | jBlacklist.ChangeLang( string langName ) |
Returns: | Nothing |
Realm: | Shared |
Description: | This function is used to change the language of the addon. (Server and client can have different languages) |
1. langName (string)
- The name of the language we want to change to.
This function does not return anything.
Function Name: | jBlacklist.Notify( number Type, string Message, player ply, boolean silent) |
Returns: | Nothing |
Realm: | Shared |
Description: | This function is used to send a notification to a player. |
1. Type (number)
- The notification-type we want to use. (Check notification-enums for more information.)
2. Message (string)
- The message we want to show.
3. ply (player)
- The player we want to show the message to. (Only needed serverside) (If left empty serverside, it will be broadcasted to everyone)
4. silent (boolean)
- This argument is optional but will limit the notification to usergroups that can see hidden messages. (Set the ply argument to nil if you want to set this to true and still broadcast it to all clients)
This function does not return anything.
Function Name: | jBlacklist.ConNotify( string Title, string Message ) |
Returns: | Nothing |
Realm: | Shared |
Description: | This function will print something to the console. |
1. Title (string)
- The title we want for the message. (Such as INFO, ALERT, ERROR)
2. Message (string)
- The message we want to show.
This function does not return anything.
Function Name: | jBlacklist.DermaQuery( string subtitle, function confirmFunc, function cancelFunc) |
Returns: | Nothing |
Realm: | Client |
Description: | This function is used to provide the client with a question. The client will then be able to confirm or cancel which then will call the corresponding function. |
1. subtitle (string)
- The question we want to show to the client.
2. confirmFunc (function)
- The function we want to be called when a player press confirm.
3. cancelFunc (function)
- The function we want to be called when a player press cancel.
This function does not return anything.
Function Name: | jBlacklist.StringRequest( string subtitle, string default, function confirmFunc, function cancelFunc) |
Returns: | Nothing |
Realm: | Client |
Description: | This function is used to provide the client with a question. The client will then be able to enter a text-input or press cancel. |
1. subtitle (string)
- The question we want to show to the client.
2. default (string)
- The default value for the string-input shown to the player.
3. confirmFunc (function)
- The function we want to be called when a player press confirm. (Parameters: string text)
4. cancelFunc (function)
- The function we want to be called when a player press cancel. (Parameters: string text)
This function does not return anything.
Function Name: | jBlacklist.Stats.GetIssued( function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function will return the total amount of issued blacklists. |
1. callbackFunc (function)
- This function will be called when the information have been received. (Parameters: number Amount)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.Stats.GetRemoved( function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function will return the total amount of removed blacklists. |
1. callbackFunc (function)
- This function will be called when the information have been received. (Parameters: number Amount)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.Stats.GetCommon( function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function will return the most common blacklist-type. |
1. callbackFunc (function)
- This function will be called when the information have been received. (Parameters: string blacklistType)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.Stats.GetTop( function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function will return the SteamID of the player that have issued the most blacklists. |
1. callbackFunc (function)
- This function will be called when the information have been received. (Parameters: string SteamID)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.Stats.GetPlayerStatistics( string steamID, function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function will return the total amount of blacklists and the most common blacklist from a player. |
1. steamID (string)
- The steamID of the player we want to get statistics about.
2. callbackFunc (function)
- This function will be called when the information have been received. (Parameters: table result) (Table structure: {string Total, string Common})
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.DataMGT.SteamIDIsValid( string steamID ) |
Returns: | boolean isValid |
Realm: | Server |
Description: | This function will return a boolean if a function is valid or not. |
1. steamID (string)
- The steamID we want to check.
1. isValid (boolean)
- The function will return true if the steamID was valid and return false if it was invalid.
Function Name: | jBlacklist.DataMGT.GetBlacklistTable( string steamID, number ID, function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function will return a specific blacklist or all blacklists from a player. |
1. steamID (string)
- The steamID of the player we want to get the blacklists from.
2. ID (number)
- The blacklistID we want to get. (Set to nil to get the whole table.)
3. callbackFunc (function)
- This function will be called when the information have been received. (Parameters: value result, string reason) (Check blacklist result structure)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.DataMGT.GetBlacklistPage( string steamID, number page, function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function will return up to 20 blacklists at once. Starting from page 1 will return the last 20 blacklists. |
1. steamID (string)
- The steamID of the player we want to get the blacklists from.
2. Page (number)
- The page of blacklists we want to get.
3. callbackFunc (function)
- This function will be called when the information have been received. (Parameters: value result, string reason) (Check blacklist result structure)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.DataMGT.AddBlacklist( table targets, table types, string reason, number length, string adminSteamID, function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function is used to add new blacklist to players. |
1. targets (table)
- A table with all SteamIDs as strings that we want to add the blacklists to.
2. types (table)
- A table with all blacklist types as strings that we want to blacklist the players from.
3. reason (string)
- The reason for the blacklists.
4. length (number)
- The length of the blacklists in seconds.
5. adminSteamID (string)
- The SteamID of the administrator that issued the blacklists or CONSOLE if it was issued by the console.
6. callbackFunc (function)
- This function will be called when the action have been completed. (Parameters: value result, string reason)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.DataMGT.UpdateBlacklist( string SteamID, number blacklistID, table blacklistTable, function callbackFunc) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function is used to modify the reason and length of the blacklist after it has been issued. (You will soon be able to modify the whole blacklist) |
1. SteamID (string)
- The SteamID of the player whose blacklist we want modify.
2. blacklistID (number)
- The ID of the blacklist that we want to modify.
3. blacklistTable (table)
- The table that holds all the blacklist information. (Check blacklist table structure for more information.)
4. callbackFunc (function)
- This function will be called when the action have been completed. (Parameters: boolean success, string reason)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.DataMGT.RemoveBlacklist( string SteamID, number blacklistID, function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function is used to remove a blacklist from a player. |
1. SteamID (string)
- The SteamID of the player whose blacklist we want to remove.
2. blacklistID (number)
- The ID of the blacklist that we want to remove.
3. callbackFunc (function)
- This function will be called when the action have been completed. (Parameters: boolean success, string reason) (NOTE: Success will still be true even if the blacklist wasn't found)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.DataMGT.EraseBlacklists( string SteamID, function callbackFunc ) |
Returns: | Nothing (Check callbackFunc) |
Realm: | Server |
Description: | This function is used to remove all blacklists from a player. |
1. SteamID (string)
- The SteamID of the player whose blacklists we want to remove.
2. callbackFunc (function)
- This function will be called when the action have been completed. (Parameters: boolean success, string reason) (NOTE: Success will still be true even if no blacklists was found)
This function does not return anything. (Check callbackFunc above)
Function Name: | jBlacklist.AddHook( string eventName, string identifier, function func ) |
Returns: | Nothing |
Realm: | Server |
Description | This function works the same as hook.Add but will only add a hook on the server. It also gives the hook priority over other hooks. It should only be used when really necessary when other addons have a chance of breaking the script. |
1. eventName (string)
- The name of the hook we want to add.
2. identifier (string)
- The identifier for the hook we want to add.
3. func (function)
- The function we want the hook to call.
This function does not return anything.
Function Name: | jBlacklist.RemoveHook( string eventName, string identifier ) |
Returns: | Nothing |
Realm: | Server |
Description | This function is used to remove hooks added with jBlacklist.AddHook. |
1. eventName (string)
- The name of the hook we want to remove.
2. identifier (string)
- The identifier for the hook we want to remove.
This function does not return anything.
Function Name: | jBlacklist.GetHookTable( ) |
Returns: | table hooksTable |
Realm: | Server |
Description | This function is used to remove hooks added with jBlacklist.AddHook. |
This function has no arguments.
1. hooksTable (table)
- A table of all hooks with the same structure as hook.GetTable.
Function Name: | jBlacklist.SQLQuery( string query, function onSuccess, function onError) |
Returns: | Nothing |
Realm: | Server |
Description | This function is used to send a SQL query to the SQLite or MySQL database depending on what setting the user has. If you want to send different queries for SQLite and MySQL you can use the jBlacklist.UseSQL variable to make an if statement. |
1. query (string)
- The query that we want to send to the SQLite or MySQL database.
2. onSuccess (function)
- This function will be called if the query is successfully sent to the SQL database. (Parameters: none empty, table result)
3. onError (function)
- This function will be called if the qyery failed. (Parameters: none empty, string error)
This function does not return anything.
Function Name: | jBlacklist.Escape( string value ) |
Returns: | string escapedValue |
Realm: | Server |
Description | This function is used to escape a value before it's used inside a query. It will call the corresponding escape function depending on if the addon is using SQLite or MySQL. |
1. value (string)
- The string that we want to escape.
1. escapedString (string)
- The string that was entered as the value argument but escaped.