The script allows for custom made frameworks to be integrated. This will guide you with each all framework specific functions
To integrate your custom framework, first create custom-template.lua in src/client/framework and src/server/framework
We do not provide assistance with custom framework integrations. Please contact your server developer to integrate the script into your framework and link this guide to them. Any errors related with custom framework integrations may not be answered.
NOTE: Contact us if the framework solution limits integration to your framework, we may open a discussion to extend the custom framework solution.
This is the first version of the documentation. If you feel unsure about the integrations, please refer to esx.lua or qb.lua to see how these frameworks have been integrated to the script.
The Framework:load() function serves as the initialization step for the client-side framework script. Its primary role is to ensure that the framework waits for the player's character to be fully loaded into the server before proceeding. This function prepares the framework for further interactions by confirming that necessary character data and resources are available and ready for use.
Framework:getPlayerIdentifier()
The Framework:getPlayerIdentifier() function is designed to retrieve the unique identifier associated with a player within the custom framework. This identifier can be used to track player data, facilitate communication, or enforce rules specific to the player throughout the game or application. The function ensures that each player's interactions are properly linked to their character, providing a basis for personalized user experiences and data management.
Framework.sendNotification(options)
The Framework.sendNotification(options) function is responsible for sending notifications to the player. The function takes in an options parameter, which is a table containing the following fields:
text (string): The message to be displayed in the notification.
label (string): A label or title for the notification, providing context or categorization.
type ('info' | 'error' | 'success' | 'warning'): The nature of the notification, determining its visual and contextual display to the user.
This function allows the framework to communicate important messages or updates directly to the player.
In the current version of the script 1.0.0 the framework function uses a "."(dot) insteal of a ":"(colon) like all other functions. This is an error on our side and my be updated in the future.
Framework:progressBar(options, cb)
The Framework:progressBar(options, cb) function is used to display a progress bar to the player. This is particularly useful for actions that require a timed interaction, such as connecting laptops or placing a WiFi Transmitter on a vehicle.
Parameters
options (table): Contains the following fields:
text (string): The message displayed along with the progress bar.
time (number): The duration of the progress bar in milliseconds.
cb (function): A callback function that is invoked once the progress bar has completed. It receives a single parameter:
success (boolean): Indicates whether the progress bar completed successfully.
This function provides a visual indication of ongoing operations, enhancing user engagement and feedback during timed activities.
Framework:getLaptopItem()
The Framework:getLaptopItem() function is designed to retrieve a laptop item with an associated metadata field.
Returns
A table representing the laptop item, including its metadata field.
This function is crucial for operations that require access to specific item details, allowing the framework to handle and manipulate items.
Framework:getWifiTransmitter()
The Framework:getWifiTransmitter() function is designed to retrieve a wifi transmitter item with an associated metadata field.
Returns
A table representing the laptop item, including its metadata field.
This function is crucial for operations that require access to specific item details, allowing the framework to handle and manipulate items.
Framework:getHackingPerks()
The Framework:getHackingPerks() function is responsible for retrieving a list of available hacking perks within the system. These perks serve as various enhancements or abilities that can be acquired and utilized within the framework. The function integrates a pre-defined talent system, where each perk corresponds to a unique talent ID from the following structured list:
This setup allows the framework to manage these perks accordingly, enabling users to enhance their capabilities by unlocking and applying the respective perks.
Server Template Code
Framework:init()
The Framework:init() function serves as an initializer for the framework. Typically, this function is where you place the setup code that needs to be executed when the framework is first loaded or used. This can include registering events, setting initial states, and preparing necessary data structures or connections. In its current placeholder state, it does not contain any logic, which means it needs to be defined and programmed based on specific server requirements. This function is crucial for ensuring that the framework is correctly configured and ready to operate efficiently.
Framework:updateLaptopItem(source, item)
The Framework:updateLaptopItem(source, item) function is designed to update the metadata of a laptop item associated with a specific source. This function is required for managing unique laptop items within the framework, allowing for modifications and updates to their individual properties or states. This capability is essential when the laptops have distinct attributes or status that need to be tracked or changed dynamically.
Framework:giveMoney(source, amount)
The Framework:giveMoney(source, amount) function is used to give a specified amount of cash to a particular client identified by the source parameter. Commonly used to give money to a client after hacking an ATM.
Framework:giveItem(source, item, amount)
The Framework:giveItem(source, item, amount) function is used to give the source a quantity of an item. This function is commonly utilized to return an item, such as a wifi transmitter.
Framework:addXp(source, amount)
The Framework:addXp(source, amount) function is used to add a specified amount of experience points (XP) to a character identified by the source parameter. This function is relevant in systems that implement a skill or talent system based on experience accumulation. If the framework does not use a perk-based talent system, this function can be disregarded.
Framework:sendDispatch(options)
The Framework:sendDispatch(options) function is designed to send a dispatch message with detailed information. The options parameter is an object that must follow the Dispatch structure. This structure includes:
priority: The priority level of the dispatch, which can be 'low', 'medium', or 'high'.
code: A string representing the dispatch code.
title: A brief title for the dispatch message.
description: A detailed description of the dispatch.
location: An object containing:
label: A label for the location.
coords: The coordinates as a vector2 object.
job: The associated job for which the dispatch is intended. The script has job defined as "police"
This function allows for structured and prioritized communication of events in dispatch systems.
Framework = {
ready = true
}
function Framework:init() end
function Framework:updateLaptopItem(source, item) end
function Framework:giveMoney(source, amount) end
function Framework:giveItem(source, item, amount) end
function Framework:removeItem(source, item, amount) end
function Framework:addXp(source, amount) end
function Framework:sendDispatch(options) end
return Framework