βš™οΈExports & Events

This document describes all configuration options for the DevHub Truck robbery resource.

Client Exports

Close Crafting UI

exports['devhub_crafting']:Close()

Closes the crafting UI if it's currently open. Useful for:

  • Closing crafting when player dies

  • Closing when player enters a vehicle

  • Integration with other UI systems

Example Usage:

-- Close crafting when player dies
AddEventHandler('esx:onPlayerDeath', function()
    exports['devhub_crafting']:Close()
end)

-- Close crafting when entering vehicle
AddEventHandler('baseevents:enteredVehicle', function()
    exports['devhub_crafting']:Close()
end)

Server Events

Community Project Completed

Triggered when a community project reaches 100% completion. Use this to:

  • Give rewards to players

  • Send Discord announcements

  • Trigger other server events

  • Log completion statistics

Example Usage:


Client Function Hooks

Define these in configs/client.lua to hook into crafting events:

CanOpenCrafting

OnCraftingOpened

OnCraftingClosed

OnCraftStart


Server Function Hooks

Define these in configs/server.lua to hook into server-side events:

CanCraft

OnCraftStart

OnAttachmentsApplied

CanUnlockBlueprint

OnBlueprintUnlocked


Integration Examples

Close Crafting on Death (ESX)

Close Crafting on Death (QBCore)

Job-Restricted Crafting Station

VIP Queue Size Bonus

Discord Webhook for Craft Completion

Last updated