GKSHOP
GKSPHONE V2

Custom Framework

Run GKSPHONE on a framework it doesn't support out of the box.

ESX, QBCore and QBox are supported directly. For anything else, the phone ships a standalone bridge you fill in with your own framework's calls.

Setup

Set the framework in gksphone/config/config.lua:

Config.Framework = "standalone"

Then implement your calls in these two files:

FileFunctions
gksphone/client/framework/standalone.lua8 — see Client
gksphone/server/framework/standalone.lua31 — see Server

Both already contain every function with a working no-op body, so the phone runs before you have implemented anything. Replace the bodies one at a time.

Both files start with if Config.Framework ~= "standalone" then return end. Keep that guard — it is what stops the file loading on an ESX or QBCore server.

esx.lua, qb.lua and qbx.lua sit in the same folders and are kept current with every release. When you are unsure what a function should return, read the ESX or QBCore version of it.

Inventory

Standalone assumes no inventory, so AddItem and RemoveItem report success without doing anything — food orders and courier deliveries complete rather than failing. To hand over real items, define these two globals from your own script:

StandaloneAddItem    = function(source, itemname, amount) return true end
StandaloneRemoveItem = function(source, itemname, amount) return true end

Return true when the item was actually given or taken. The phone bills the player on that result.

If you run a real inventory resource, point Config.Inventory at it instead — see Custom inventory. The two are independent: framework and inventory are configured separately.

On this page