Standalone Tablet

You can configure this to register a usable item that fits your framework if enabled in the shared/config.lua file.

-- Purpose: Framework specific usable item creation. 
if Config.EnableStandaloneTablet and Config.TabletItemName then
    if Config.Framework == "qbcore" then
        Framework.Functions.CreateUseableItem(Config.TabletItemName, function(source)
            TriggerClientEvent("gs-trucking:client:openTablet", source)
        end)
    elseif Config.Framework == "esx" then
        Framework.RegisterUsableItem(Config.TabletItemName, function(source)
            TriggerClientEvent("gs-trucking:client:openTablet", source)
        end)
    end
end

Get Player

This is used to get framework specific data for the players source ID

-- Purpose: Function to get the player object from the source ID.
-- source [int]: Players source ID
function GetPlayer(source)
    if not source then return nil end
    if Config.Framework == "qbcore" then
        return Framework.Functions.GetPlayer(source)
    elseif Config.Framework == "esx" then
        return Framework.GetPlayerFromId(source)
    end
end

Get Identifier

This is used mostly in the reputation system as it stores reputation in the database connected to their character identifier. You can modify to your requirements if they are different from the default


Get Players Money

Checks a players account as configured, mostly used for the truck rental system

Give Player Money

This is triggered when a job is completed or a rental truck is returned. It passes an extra argument to indicate whether or not a job is illegal or not. You can configure this however you need. (Does not get triggered if the payout is $0)


Remove Player Money

This is triggered when a player rents a truck and the rental fee is more than $0


Player Reputation (Add/Remove)

These functions are only triggered when the reputation system is enabled. I added them incase you want to configure anything else such as the notification or for example QBCore has its own 'jobrep' metadata that you can also update here.


Police Count

This is where you can configure the function that checks to see if there's enough police on duty for an illegal job to be started

Last updated