Exports and events

Open the boosting tablet from other scripts, check VIN-scratched plates and run code when a boost finishes.

Open the tablet

From a client script:

Lua
TriggerEvent('gg_boosting:client:open_tablet')

From a server script, pass the player's server id:

Lua
TriggerClientEvent('gg_boosting:client:open_tablet', source)

The client event can fire once every 3 seconds. It sends gg_boosting:server:open_tablet, which opens the tablet for the player who sent it. Neither checks for the gg_boosting_tablet item.

Note Do not call TriggerEvent('gg_boosting:server:open_tablet', source) from the server. That route does not open the tablet. Use TriggerClientEvent as shown above.

Close the tablet

Lua
-- client
TriggerEvent('gg_boosting:client:close_tablet')

-- server
TriggerClientEvent('gg_boosting:client:close_tablet', source)

isVehicleVinscratched

Checks whether a plate belongs to a car a player got from a VIN scratch. It works on the client and on the server.

Lua
local scratched = exports.gg_boosting:isVehicleVinscratched(plate)
ParameterTypeDescription
platestringThe vehicle's plate, without leading or trailing spaces
ReturnsTypeDescription
scratchedbooleantrue if the plate is a VIN-scratched car, otherwise false

On the client it asks the server and waits for the answer, so call it from a thread or an event handler.

Lua
local plate = 'ABCD1234'

if exports.gg_boosting:isVehicleVinscratched(plate) then
    print(('Plate %s is a VIN scratch.'):format(plate))
end

A plate that no longer exists in player_vehicles (QBCore, Qbox) or owned_vehicles (ESX) is cleared from the list when gg_boosting starts.

Run code when a boost finishes

gg_boosting/base/core/open/server/hooks.lua is open for editing. hooks.onBoostComplete runs on the server once for every member of the group when a boost is delivered.

FieldTypeDescription
payload.player.sourcenumberServer id
payload.player.identifierstringFramework identifier
payload.player.namestringBoosting alias
payload.player.leaderbooleantrue for the group leader
payload.job.vehiclestringVehicle model
payload.job.labelstringVehicle label
payload.job.classstringContract class, for example "A+"
payload.job.payoutnumberThis player's XNT share with level bonus. A VIN scratch does not pay it.
payload.job.repnumberReputation this player got, with level bonus
payload.job.vinScratchbooleantrue for a VIN scratch
payload.group_idnumberGroup id

To run something once per group, check the leader:

Lua
hooks.onBoostComplete = function(payload)
    if not payload.player.leader then return end
    print(('%s finished a %s class boost'):format(payload.player.name, payload.job.class))
end

Restart gg_boosting after you edit the file.

Support

Questions before you buy?

Ask the team in our Discord before you pay a thing. Setup help, update notes, giveaways and discount codes, all in one place.

831 online now2,241 members