Server

Ensure you review the qb.lua and esx.lua files to understand how the phone integrates with each framework. These files are kept up to date with the latest changes.

Step 1: Framework Compatibility Check

At the beginning of your integration file, add a check for Config.Framework to avoid loading for unsupported frameworks.

if Config.Framework ~= "your-framework" then
    return
end

Step 2: Required Framework Functions

Below are the essential functions you need to implement for the phone to function correctly with your custom framework.

GetIdentifier

Retrieve the current character's identifier. For multi-character setups, return the active character's identifier.

function GetIdentifier(source)
    -- This is an example from the gksphone esx.lua file
    return Config.Core.GetPlayerFromId(source)?.identifier
end

GetPlayerFromIdentifier

Check if a character is online using their identifier.

GetCharacterName

Returns the character's full name.

GetCharacterBirthDate

Returns the character's birth date.

GetCharacterAllVehicles

Returns a list of all vehicles owned by a player.

GetVehicle

Fetch a specific vehicle using its plate number.

VehicleUpdate

Updates vehicle status when it's retrieved via valet

VehicleUpdateCarseller

Handles vehicle ownership changes made through the Car Seller app.

GetCharacterJob

Retrieves job-related data for the character.

GetJobs

Returns a list of available jobs in the framework.

GetAllEmployees

Fetches a list of employees (online and offline) for a specific job.

SetJob

Updates a player's job and grade.

ToggleDuty

Changes a character's duty status.

GetBankBalance

Returns the current bank balance of a character.

GetBankBalanceByIndetifier

Returns the bank balance based on the character's identifier.

RemoveBankMoney

Deducts money from a character's bank account.

AddBankMoney

Adds money to a character's bank account.

GetExtendedPlayers

Returns an array of player sources with a specified job.

RegisterUsableItem

Registers a usable item and sets a callback for when the item is used.

RemoveItem

Removes a specific item from a player's inventory.

FreamworkSavePhoneNumber

Saves a player's phone number to the framework's meta or SQL data.

FreamworkGetPhoneNumberBySource

Retrieves a player's registered phone number.

HasPhoneItem

Checks if the player has a phone item in their inventory.

CallingPlayerStatus

Determines if a player is available to receive calls based on handcuff or downed status.

GetOfflinePlayerByIdentifier

Returns limited data about an offline player using their identifier.

Society (Job System)

SocietyGetMoney

Returns the amount of money in the job's account.

SocietyRemoveMoney

Deducts money from the job's account, if sufficient funds exist.

SocietyAddMoney

Adds money to the job's account.

Note:

  • The code samples provided are from esx.lua and qb.lua.

  • Replace placeholder logic with implementations based on your framework structure.

  • Ensure all data formats and player handling methods are compatible with your existing systems.

Last updated