### Start order for hex_jobscreator in server.cfg Source: https://docs.resync.me/docs/hexscripts/jobscreator/installation Example server.cfg configuration showing the correct start order: oxmysql, framework (es_extended, qb-core, or qbx_core), then hex_jobscreator or the [hex] folder. ```plaintext # 1. Start database wrapper called oxmysql ensure oxmysql # 2. Start the specific framework ensure es_extended or qb-core or qbx_core # 3. Now start our asset singularly ensure hex_jobscreator # Or you can start all of our assets at once into a folder called [hex] ensure [hex] ``` -------------------------------- ### server.cfg startup order for hex_banking Source: https://docs.resync.me/docs/hexscripts/classic/banking/installation Add these lines to your server.cfg to start the required dependencies and the hex_banking asset in the correct order. The framework line is a placeholder; replace it with the actual ensure command for your framework (es_extended, qb-core, or qbx_core). The final line shows an alternative to start all assets in a [hex] folder. ```cfg # 1. Start database wrapper called oxmysql ensure oxmysql # 2. Start the specific framework ensure es_extended or qb-core or qbx_core # 3. Now start our asset singularly ensure hex_banking # Or you can start all of our assets at once into a folder called [hex] ensure [hex] ``` -------------------------------- ### Configure server.cfg for hex_aimlab Source: https://docs.resync.me/docs/hexscripts/classic/aimlab/installation Add these lines to your server.cfg to ensure the script starts correctly. You can either start the asset individually or start a folder containing multiple assets. ```text # 1. start our asset singularly ensure hex_aimlab # Or you can start all of our assets at once into a folder called [hex] ensure [hex] ``` -------------------------------- ### Start script Source: https://docs.resync.me/docs/hexscripts/jobscreator/installation Ensures the required resources and the hex_jobscreator script are started in the correct order. ```APIDOC ## ensure hex_jobscreator ### Description Starts the hex_jobscreator resource after ensuring oxmysql and the framework are running. ### Method CONFIG ### Endpoint server.cfg ### Configuration - **ensure oxmysql** (string) - Required - Starts the database wrapper. - **ensure es_extended or qb-core or qbx_core** (string) - Required - Starts the specific framework. - **ensure hex_jobscreator** (string) - Required - Starts the asset singularly. - **ensure [hex]** (string) - Optional - Starts all assets in the [hex] folder at once. ### Example ``` # 1. Start database wrapper called oxmysql ensure oxmysql # 2. Start the specific framework ensure es_extended or qb-core or qbx_core # 3. Now start our asset singularly ensure hex_jobscreator # Or you can start all of our assets at once into a folder called [hex] ensure [hex] ``` ``` -------------------------------- ### showJobMenu export example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/worker-id-menus Calls the showJobMenu export to present the restaurant menu from player 5 to player 12. Skips the distance check. Returns true on success or false with a reason code. ```lua local ok, err = exports['hex_jobscreator']:showJobMenu(5, 12) ``` -------------------------------- ### Automatic Configuration Detection Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations This script automatically detects the active framework, progress bar, notification system, and menu API by checking the state of installed resources. It provides fallback configurations and prints warnings if required dependencies are missing. ```lua if Config.Framework == 'automatic' then if GetResourceState('es_extended') == 'started' then Config.Framework = 'esx' elseif GetResourceState('qb-core') == 'started' then Config.Framework = 'qbcore' else Config.Framework = 'standalone' end end local hexHuds = { 'hex_genesis_hud', 'hex_4_hud', 'hex_final_hud', 'hex_2_hud', 'hex_future_hud', 'hex_1_hud', 'hex_hud_prem', 'hex_hud', 'hex_finalhud_v2' } local function isAnyHexHudEnabled() for _, hud in ipairs(hexHuds) do if GetResourceState(hud) == 'started' then return true end end return false end if Config.Progressbar == 'automatic' then if isAnyHexHudEnabled() then Config.Progressbar = 'hex' elseif GetResourceState('ox_lib') == 'started' then Config.Progressbar = 'ox_lib' elseif GetResourceState('esx_progressbar') == 'started' then Config.Progressbar = 'esx' else Config.Progressbar = 'none' print('[^1WARNING^7] No progressbar resource found, please configure one in the config and code.') end end if Config.Notify == 'automatic' then if isAnyHexHudEnabled() then Config.Notify = 'hex' elseif GetResourceState('ox_lib') == 'started' then Config.Notify = 'ox_lib' elseif GetResourceState('esx_notify') == 'started' then Config.Notify = 'esx' else Config.Notify = 'default' print('[^1WARNING^7] No notify resource found, setting to default.') end end if Config.HelpNotify == 'automatic' then if isAnyHexHudEnabled() then Config.HelpNotify = 'hex' elseif GetResourceState('ox_lib') == 'started' then Config.HelpNotify = 'ox_lib' elseif GetResourceState('esx_notify') == 'started' then Config.HelpNotify = 'esx' else Config.HelpNotify = 'default' print('[^1WARNING^7] No notify resource found, setting to default.') end end if Config.Menu == 'automatic' then if GetResourceState('hex_menu_api') == 'started' then Config.Menu = 'hex_menu_api' elseif GetResourceState('ox_lib') == 'started' then Config.Menu = 'ox_lib' if Config.DefaultMenuPosition == 'left' then Config.DefaultMenuPosition = 'bottom-right' end elseif GetResourceState('esx_menu_default') == 'started' or GetResourceState('hex_3_menu_default') == 'started' then Config.Menu = 'esx' if Config.DefaultMenuPosition == 'left' then Config.DefaultMenuPosition = 'left-center' end else Config.Menu = 'none' print('[^1WARNING^7] No menu resource found, please configure one in the config and code.') end end if Config.Debug then print(('[^2INFO^7] Using %s for Progressbar, %s for Notify and %s for HelpNotify.'):format(Config.Progressbar, Config.Notify, Config.HelpNotify)) end ``` -------------------------------- ### writeJobLog example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/logs Writes an entry into the job's audit log. The log category is set to the name of the resource that called the export. Returns true on success, or false with a reason (invalid_job or invalid_action) on failure. ```lua exports['hex_jobscreator']:writeJobLog(5, 'police', 'Impounded a vehicle', 'Sultan RS', { plate = 'ABC 123' }) ``` -------------------------------- ### Add unsafe worker permission for hex_jobscreator Source: https://docs.resync.me/docs/hexscripts/jobscreator/installation Add this line to server.cfg before starting the framework resource to allow the script to run its installer. ```plaintext add_unsafe_worker_permission hex_jobscreator ``` -------------------------------- ### getJobBadges return shape example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/badges Shows the shape of the table returned by getJobBadges, containing entries with identifier and badge fields. ```lua { { identifier = 'char1:abc...', badge = 'A102' }, ... } ``` -------------------------------- ### getPlayerBadge export example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/badges Calls the getPlayerBadge export to retrieve a player's badge for their current job. Returns the badge string, or nil with a reason such as invalid_player, player_not_found, no_job, or no_badge. ```lua local badge, err = exports['hex_jobscreator']:getPlayerBadge(5) ``` -------------------------------- ### getJobBadges export example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/badges Calls the getJobBadges export to list every badge issued for the 'police' job. Returns a table of badges, or a table with 'no_badges' if none, or nil with 'invalid_job' if the job name is not a non-empty string. ```lua local badges, err = exports['hex_jobscreator']:getJobBadges('police') ``` -------------------------------- ### getJobData - Get local player's job Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/player-info Returns a table with the player's job details (name, label, grade, gradeName, gradeLabel, salary, onDuty, is2Job) or nil with 'no_job' if the player has no job in that slot. ```lua local job = exports['hex_jobscreator']:getJobData() ``` -------------------------------- ### Server Configuration Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations Defines the server name and subtitles for the boss menu. ```lua Config.Server = { Name = 'HEXSCRIPTS', Subtitle = 'Fraction Creator', Subtitle2 = 'Boss Menu' } ``` -------------------------------- ### Configure server.cfg for hex_airdrop Source: https://docs.resync.me/docs/hexscripts/classic/airdrop/installation Add these lines to your server.cfg to ensure the database wrapper, framework, and the hex_airdrop asset are loaded in the correct order. ```text # 1. Start database wrapper called oxmysql ensure oxmysql # 2. Start the specific framework ensure es_extended or qb-core or qbx_core # 3. Now start our asset singularly ensure hex_airdrop # Or you can start all of our assets at once into a folder called [hex] ensure [hex] ``` -------------------------------- ### getJobMemberCount Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/jobs Server export to get the online member count for a job, counting both job slots. ```APIDOC ## getJobMemberCount ### Description Returns the number of online members for a job, counting both job slots. ### Method N/A (Server Export) ### Endpoint `exports['hex_jobscreator']:getJobMemberCount(jobName)` ### Parameters - **jobName** (string) - Required - The name of the job. ### Returns - **number**: How many members are online. - **nil, reason**: `invalid_job` or `unknown_job` ``` -------------------------------- ### Client: Listen for 'dummy_full' interaction and read values Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/custom-interactions/example Listens for the 'hex_jobscreator:creator:processInteraction' event and reads the configured values for the 'dummy_full' interaction. Prints the values to the console. Note that the 'gear' field is printed but not defined in the server registration. ```lua RegisterNetEvent('hex_jobscreator:creator:processInteraction', function(interactionType, interactionId, is2Job, interactionData) if interactionType ~= 'dummy_full' then return end if not interactionData or not next(interactionData) then return end print('Custom API recieved interaction:', interactionData.title) print('Enabled:', interactionData.enabled) print('Amount:', interactionData.amount) print('Category:', interactionData.category) print('Accent:', json.encode(interactionData.accent)) print('Accounts:', json.encode(interactionData.money)) print('Weapons:', json.encode(interactionData.guns)) print('Items:', json.encode(interactionData.gear)) print('Vehicles:', json.encode(interactionData.vehicles)) end) ``` -------------------------------- ### getClosestInteraction - Returned point table shape Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/player-info Example of the table returned by getClosestInteraction, showing the structure of the interaction point. ```lua { id = 42, type = 'storage', label = 'Armory', distance = 18.4, is2Job = false, public = false, coords = { x = 441.2, y = -981.5, z = 30.7 } } ``` -------------------------------- ### Viewer Configuration Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations Defines the viewer settings with a dict, clip, flag, and prop model with bone and offsets. ```lua viewer = { dict = 'amb@code_human_wander_clipboard@male@base', clip = 'static', flag = 49, prop = { model = 'bkr_prop_fakeid_singledriverl', bone = 60309, offset = { x = 0.000, y = -0.005, z = -0.010 }, rotation = { x = 75.000, y = 0.000, z = 0.000 } } } ``` -------------------------------- ### getJobData - Returned job table shape Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/player-info Example of the table returned by getJobData, showing the structure of the job data. ```lua { name = 'police', label = 'Police', grade = 3, gradeName = 'sergeant', gradeLabel = 'Sergeant', salary = 250, onDuty = true, is2Job = false } ``` -------------------------------- ### openRestrauntMenu Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/restaurant-menu Client export to show a business menu card on the local player's screen. ```APIDOC ## openRestrauntMenu ### Description Shows a menu card on screen and plays the reading animation with the configured prop. ### Method N/A (Client Export) ### Endpoint `exports['hex_jobscreator']:openRestrauntMenu` ### Parameters #### Request Body - **url** (string) - Required - The URL of the menu image. - **label** (string) - Optional - The label of the menu (e.g., restaurant name). - **from** (string) - Optional - The name of the person providing the menu. ### Request Example ```lua exports['hex_jobscreator']:openRestrauntMenu({ url = 'https://example.com/menu.png', label = 'Unicorn', from = 'John Doe' }) ``` ### Response #### Success Response - **true** - Menu shown. #### Error Response - **false, reason** - See reasons below. #### Reasons - **invalid_data** - The argument must be a table. - **missing_url** - `url` is required. - **player_dead** - The player is fatally injured. ``` -------------------------------- ### Add unsafe worker permission Source: https://docs.resync.me/docs/hexscripts/jobscreator/installation Adds the required unsafe worker permission to server.cfg to allow the script installer to run. ```APIDOC ## add_unsafe_worker_permission hex_jobscreator ### Description Adds the required unsafe worker permission to server.cfg to allow the script installer to run. ### Method CONFIG ### Endpoint server.cfg ### Configuration - **line** (string) - Required - The exact line to add: `add_unsafe_worker_permission hex_jobscreator` ### Example ``` add_unsafe_worker_permission hex_jobscreator ``` ``` -------------------------------- ### openKitchen Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/interactions Opens the kitchen. Takes an optional interaction id to target a specific point, or uses the closest one the player has access to. ```APIDOC ## openKitchen ### Description Opens the kitchen. Takes an optional interaction id to target a specific point, or uses the closest one the player has access to. ### Method Client Export ### Endpoint `exports['hex_jobscreator']:openKitchen(interactionId?)` ### Parameters #### Optional Parameters - **interactionId** (number) - Optional - The ID of the interaction point to open. If omitted, the closest accessible point is used. ### Request Example ```lua exports['hex_jobscreator']:openKitchen() ``` ### Response #### Success Response - **true** - Kitchen opened. #### Error Response Returns `false, reason` where reason can be a shared resolve reason or one of the extra reasons below. #### Extra Reasons - **already_open** - The page is already open. - **handcuffed** - Cuffed players cannot open this. - **not_on_duty** - The job has a duty point and the player is clocked out. - **rejected_by_server** - The server refused to open it. ``` -------------------------------- ### getPlayerBadge Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/badges Gets a player's badge for a job. The jobName argument is optional and defaults to the player's current job (primary slot first, then second). ```APIDOC ## getPlayerBadge ### Description A player's badge for a job. ### Method Server Export ### Endpoint exports['hex_jobscreator']:getPlayerBadge(playerId, jobName?) ### Parameters - **playerId** (number) - Required - The player ID. - **jobName** (string) - Optional - The job name. Leave out to use the player's current job (primary slot first, then second). ### Request Example local badge, err = exports['hex_jobscreator']:getPlayerBadge(5) ### Response #### Success Response - **string** - The badge. #### Error Response - **nil, reason** - `invalid_player` · `player_not_found` · `no_job` · `no_badge` ``` -------------------------------- ### setJobClosed Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/business-state Server export to open or close a business and push the new state to every client, updating blips exactly as the in-game open/close point does. ```APIDOC ## setJobClosed ### Description Server export to open or close a business and push the new state to every client, updating blips exactly as the in-game open/close point does. ### Method Server Export ### Endpoint exports['hex_jobscreator']:setJobClosed(jobName, closed) ### Parameters #### Parameters - **jobName** (string) - Required - The name of the job. - **closed** (boolean) - Required - Whether the business should be closed. ### Returns - **true** - State applied; already being in that state also returns true. - **false, reason** - invalid_job, unknown_job, invalid_state. ### Example ```lua exports['hex_jobscreator']:setJobClosed('mechanic', true) ``` ``` -------------------------------- ### getJobMenuUrl export example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/worker-id-menus Calls the getJobMenuUrl export to retrieve the menu image URL for the job named 'unicorn'. Returns the URL string on success or nil with a reason code. ```lua local url, err = exports['hex_jobscreator']:getJobMenuUrl('unicorn') ``` -------------------------------- ### Menu Prop Configuration Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations Defines the menu prop model, bone, offset, and rotation. ```lua Config.MenuProp = { model = 'prop_tourist_map_01', bone = 28422, offset = { x = 0.0, y = 0.0, z = 0.0 }, rotation = { x = 0.0, y = 0.0, z = 0.0 } } ``` -------------------------------- ### getPlayerBills return table shape Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/billing Example of the table structure returned by getPlayerBills. Each entry contains the bill id, label, amount, job label, sender name, and creation timestamp. ```lua { { id = 8, label = 'Towing', amount = 500, jobLabel = 'Mechanic', senderName = 'John Doe', createdAt = '...' }, ... } ``` -------------------------------- ### Open Kitchen Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/interactions Opens the kitchen interface. This export requires a thread. ```lua local ok, err = exports['hex_jobscreator']:openKitchen() ``` -------------------------------- ### Actions Configuration Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations Defines action settings for revive, heal, repair, wash, hijack, impound, and placeObject. ```lua Config.Actions = { revive = { item = 'medikit', amount = 1, duration = 6000 }, heal = { small = { item = 'bandage', amount = 1, duration = 8000, health = 40 }, big = { item = 'medikit', amount = 1, duration = 8000, health = 100 } }, repair = { item = false, amount = 1, duration = 6000 }, wash = { item = false, amount = 1, duration = 6000 }, hijack = { duration = 6000 }, impound = { duration = 5000 }, placeObject = { despawnDistance = 0.0, clearMinGrade = 0 } } ``` -------------------------------- ### showWorkerId export example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/worker-id-menus Calls the showWorkerId export to present player 5's worker ID to player 12. Skips the distance check. Returns true on success or false with a reason code. ```lua local ok, err = exports['hex_jobscreator']:showWorkerId(5, 12) ``` -------------------------------- ### Open Crafting Menu Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/interactions Opens the crafting menu for the player. ```lua local ok, err = exports['hex_jobscreator']:openCrafting() ``` -------------------------------- ### getLicenses export Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/licenses Retrieves all available license types. Returns a table of license objects or 'no_licenses' if empty. ```lua local licenses, err = exports['hex_jobscreator']:getLicenses() ``` ```lua { { type = 'dmv', label = 'Driving Permit' }, ... } ``` -------------------------------- ### Cuff Sound Configuration Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations Defines the cuff sound file and volume. ```lua Config.CuffSound = { file = 'cuffSound.mp3', volume = 0.4 } ``` -------------------------------- ### getClosestInteraction - Get nearest interaction of a type Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/player-info Returns a table with the closest interaction point (id, type, label, distance, is2Job, public, coords) or nil with a reason (invalid_type or none_configured). Range is not checked; read distance from the result. ```lua local point = exports['hex_jobscreator']:getClosestInteraction('storage') ``` -------------------------------- ### cfg.lua - HEX Aimlab Configuration Source: https://docs.resync.me/docs/hexscripts/classic/aimlab/configurations Full configuration file for the HEX Aimlab script. Defines NPC models, spawn coordinates, blip settings, locales, weapon loadout, and difficulty modes. Includes helper functions HelpNotify and weaponWheel that support ox_inventory, qs-inventory, and jaksam_inventory. ```lua Config = {} AimlabNPC = 'mp_m_exarmy_01' --Enter NPC RollNPC = 'cs_fbisuit_01' --Roll Target NPC AimlabSpawn = vector4(-3042.2407, -1504.7079, 233.3947, 92.2853) RollSpawn = vector4(-3025.4670, -1506.4186, 233.3855, 268.8994) DefaultDimension = 0 AimlabSpots = { --Points where to enter the LABS ['Roll Train'] = { vector4(232.3267, -903.7983, 29.6920, 55.4587), }, ['Aim Lab'] = { vector4(229.6487, -907.3605, 29.6920, 54.2927), } } Blip = { enabled = true, sprite = 84, --https://wiki.rage.mp/index.php?title=Blips#Blip_model color = 1, --https://wiki.rage.mp/index.php?title=Blips#Blip_colors scale = 0.85, --Blip Size short = false, --Short Range text = 'HEX Aimlab', --Text } Config.Locales = { ['enter'] = '[~r~AIM~s~LAB] Press E', ['aimtrain'] = '~r~AIM~s~LAB AIM TRAIN', ['rolltrain'] = '~r~AIM~s~LAB ROLL TRAIN', ['hitted'] = 'Hitted Targets: ', ['timerem'] = 'Time Remaining:~y~ ', ['highscore'] = '~g~NEW~s~ HIGHSCORE: ' } FreezePlayer = false --Freeze the Player in AIMLAB UseOwnWeapons = false Weapons = { -- Weapons to give in the Aimlab, if UseOwnWeapons is false, it will give the player these weapons, if true own weapons will be used. { weaponName = 'WEAPON_PISTOL', components = { 'COMPONENT_AT_PI_SUPP_02', -- suppressor } } } Modes = { ['Aim Lab'] = { enabled = true, -- Enable/disable this mode (removes its blip and entrance) startDifficulty = 'medium', difficulties = { -- Time in ms the player has to hit a target ['easy'] = { msToHit = 1750 }, ['medium'] = { msToHit = 1250 }, ['hard'] = { msToHit = 750 }, } }, ['Roll Train'] = { enabled = true, -- Enable/disable this mode (removes its blip and entrance) startDifficulty = 'medium', difficulties = { -- Time in ms the player has to hit a target ['easy'] = { msToHit = 1750 }, ['medium'] = { msToHit = 1250 }, ['hard'] = { msToHit = 750 }, } } } function HelpNotify(msg) AddTextEntry('esxHelpNotification', msg) BeginTextCommandDisplayHelp('esxHelpNotification') EndTextCommandDisplayHelp(0, false, true, -1) end function weaponWheel(state) if GetResourceState('ox_inventory') == 'started' then exports['ox_inventory']:weaponWheel(state) elseif GetResourceState('qs-inventory') == 'started' then exports['qs-inventory']:WeaponWheel(state) elseif GetResourceState('jaksam_inventory') == 'started' then exports['jaksam_inventory']:setWeaponWheel(state) end end ``` -------------------------------- ### registerInteraction usage example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/custom-interactions Registers a custom interaction type named 'my_atm' with a label and a data table defining fields for fee, screen colour, and required items. The data table uses field types like 'number', 'color', and 'itemlist' with their respective options. ```lua exports['hex_jobscreator']:registerInteraction({ name = 'my_atm', label = 'My ATM', data = { { name = 'fee', label = 'Fee', type = 'number', min = 0, max = 100, default = 5 }, { name = 'tint', label = 'Screen Colour', type = 'color', hasColorPicker = true }, { name = 'needed', label = 'Required Items', type = 'itemlist', min = 1, max = 5 } } }) ``` -------------------------------- ### openBillingMenu Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/billing Opens the job billing menu for the player's job with billing enabled and sufficient grade. Returns true on success or false with a reason code. ```APIDOC ## openBillingMenu ### Description Opens the job billing menu (send a bill / view sent bills) for whichever of the player's two jobs has billing enabled and a high enough grade. ### Method Client Export ### Endpoint exports['hex_jobscreator']:openBillingMenu() ### Parameters None ### Request Example local ok, err = exports['hex_jobscreator']:openBillingMenu() ### Response #### Success Response - `true` - menu opened #### Error Response - `false, reason` - see reasons below #### Reasons - `handcuffed` - cuffed players cannot open this - `billing_disabled` - no job of this player has billing switched on - `grade_too_low` - the player's grade is below the required minimum - `not_on_duty` - the job has a duty point and the player is clocked out ``` -------------------------------- ### Cuff System Items Configuration Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations Defines the items used for cuffing and uncuffing. ```lua Config.CuffSystemItems = { cuff = { item = false, amount = 1 }, uncuff = { item = false, amount = 1 } } ``` -------------------------------- ### setPlayerBadge export example Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/badges Assigns the badge 'A102' to player 5 for their current job. Badges are up to four digits with an optional single leading letter, unique per job, and an empty string clears the badge. Returns true on success, or false with a reason such as invalid_player, player_not_found, no_job, badge_taken, or invalid_badge. ```lua local ok, err = exports['hex_jobscreator']:setPlayerBadge(5, 'A102') ``` -------------------------------- ### getLicenses Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/licenses Returns every licence type that exists. ```APIDOC ## getLicenses ### Description Returns every licence type that exists. ### Method N/A (Server Export) ### Endpoint `exports['hex_jobscreator']:getLicenses()` ### Parameters None ### Request Example ```lua local licenses, err = exports['hex_jobscreator']:getLicenses() ``` ### Response #### Success Response - **table** - the licence types, shape below - **table, 'no_licenses'** - the list is empty #### Response Example ```lua { { type = 'dmv', label = 'Driving Permit' }, ... } ``` ``` -------------------------------- ### openRestrauntMenu export usage Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/restaurant-menu Shows a menu card on screen and plays the reading animation with the configured prop. The argument must be a table; url is required. Returns true if shown, or false with a reason: invalid_data, missing_url, or player_dead. ```lua exports['hex_jobscreator']:openRestrauntMenu({ url = 'https://example.com/menu.png', label = 'Unicorn', from = 'John Doe' }) ``` -------------------------------- ### addHandcuffs Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/handcuffs Cuffs the local player. Plays the cuff sound, applies the animation, blocks the usual controls and writes the state so it survives a reconnect exactly like being cuffed by a police officer in game. ```APIDOC ## addHandcuffs ### Description Cuffs the local player. Plays the cuff sound, applies the animation, blocks the usual controls and writes the state so it survives a reconnect exactly like being cuffed by a police officer in game. ### Method Client Export ### Endpoint `exports['hex_jobscreator']:addHandcuffs(cuffType)` ### Parameters - `cuffType` (number) - Optional - The type of cuffs to apply. Must be `0` or `1`. ### Returns - `true` - cuffs applied - `false, reason` - see the reasons below ### Reasons - `invalid_cuff_type` - cuff type must be `0` or `1` - `already_handcuffed` - the player is already cuffed - `player_dead` - the player is fatally injured ### Example lua local ok, err = exports['hex_jobscreator']:addHandcuffs(0) ``` -------------------------------- ### Export return value conventions Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports Illustrates the return shape for actions, boolean questions, value getters, and list getters. The answer comes first, and a reason code comes second when applicable. ```lua -- an action: true on success, false + a reason when it did not happen local ok, err = exports['hex_jobscreator']:openBossMenu() if not ok then print(err) end --> 'no_permission' -- a boolean question: the answer, plus why it is what it is local cuffed = exports['hex_jobscreator']:isPlayerHandcuffed() -- a value getter: the value, or nil + a reason local card, err = exports['hex_jobscreator']:getPlayerBadge(5) if not card then print(err) end --> 'no_badge' -- a list getter: always a table, plus a reason when the table is empty local bills, err = exports['hex_jobscreator']:getPlayerBills(5) if err == 'no_bills' then ... end ``` -------------------------------- ### Open Boss Menu Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/interactions Opens the boss page. This export requires a thread. ```lua local ok, err = exports['hex_jobscreator']:openBossMenu() ``` -------------------------------- ### giveLicense export Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/licenses Issues a specified license to a player. ```lua local ok, err = exports['hex_jobscreator']:giveLicense(5, 'dmv') ``` -------------------------------- ### Action Menu Configuration Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations Defines the action menu items for civil, ems, vehicle, license, and object_spawner categories. ```lua Config.ActionMenu = { ['civil'] = { 'handcuff_back', 'handcuff_front', 'release', 'search', 'drag', 'put_in_vehicle', 'out_vehicle', }, ['ems'] = { 'revive', 'small', 'big', 'ems_putin', 'ems_putout', }, ['vehicle'] = { 'vehicle_info', 'hijack', 'repair', 'wash', 'impound', 'plate_lookup', 'low_loader', }, ['license'] = { 'give_license', 'revoke_license', }, ['object_spawner'] = {} } ``` -------------------------------- ### isPlayerEscorting - check escort state and target Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/handcuffs Returns true and the target server ID if dragging someone, or false with 'being_escorted' or 'not_escorting'. ```lua local escorting, target = exports['hex_jobscreator']:isPlayerEscorting() if escorting then print('dragging player ' .. target) end ``` -------------------------------- ### Route Booster Items Configuration Source: https://docs.resync.me/docs/hexscripts/jobscreator/configurations Defines booster items for farming, processing, and crafting with duration and multiplier. ```lua Config.RouteBoosterItems = { -- Create the Items yourself, this Script only gives them functionality. ['farm_booster'] = { label = 'Farm Booster', -- label for the item duration = 600, -- in seconds (10 minutes) multiplier = 1.5, -- 1.5x faster type = 'harvest' -- harvest, processing, crafting }, ['processing_booster'] = { label = 'Processing Booster', duration = 600, multiplier = 1.5, type = 'processing' }, ['crafting_booster'] = { label = 'Crafting Booster', duration = 600, multiplier = 1.5, type = 'crafting' } } ``` -------------------------------- ### showJobMenu Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/server/worker-id-menus The same thing as showWorkerId but for the restaurant menu. Skips the distance check. ```APIDOC ## showJobMenu ### Description The same thing for the restaurant menu. Skips the distance check. ### Method Server Export ### Endpoint `exports['hex_jobscreator']:showJobMenu(playerId, targetId)` ### Parameters - **playerId** (number) - Required - The player ID of the sender. - **targetId** (number) - Required - The player ID of the target. ### Request Example ```lua local ok, err = exports['hex_jobscreator']:showJobMenu(5, 12) ``` ### Response #### Success Response - `true` - menu sent #### Error Response - `false, reason` - see reasons below #### Reasons - `invalid_player` - player id must be a number - `same_player` - source and target must differ - `player_not_found` - no such sender on the server - `target_not_found` - no such target player on the server - `no_menu_configured` - no restaurant menu is set up ``` -------------------------------- ### openBossMenu Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/interactions Opens the boss page. Takes an optional interaction id to target a specific point, or uses the closest one the player has access to. ```APIDOC ## openBossMenu ### Description Opens the boss page. Takes an optional interaction id to target a specific point, or uses the closest one the player has access to. ### Method Client Export ### Endpoint `exports['hex_jobscreator']:openBossMenu(interactionId?)` ### Parameters #### Optional Parameters - **interactionId** (number) - Optional - The ID of the interaction point to open. If omitted, the closest accessible point is used. ### Request Example ```lua exports['hex_jobscreator']:openBossMenu() -- closest boss point exports['hex_jobscreator']:openBossMenu(42) -- that exact point ``` ### Response #### Success Response - **true** - Boss page opened. #### Error Response Returns `false, reason` where reason can be a shared resolve reason or one of the extra reasons below. #### Extra Reasons - **handcuffed** - Cuffed players cannot open this. - **rejected_by_server** - The server refused to open it (out of range, or access changed). ### Notes Calling it while the page is already open reloads it with fresh data, which is harmless. ``` -------------------------------- ### Open Interaction Menu with Optional ID Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/interactions Demonstrates how to open a boss menu by either targeting the closest point or a specific interaction ID. ```lua exports['hex_jobscreator']:openBossMenu() -- closest boss point exports['hex_jobscreator']:openBossMenu(42) -- that exact point ``` -------------------------------- ### openCrafting Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/interactions Opens the crafting menu. Takes an optional interaction id to target a specific point, or uses the closest one the player has access to. ```APIDOC ## openCrafting ### Description Opens the crafting menu. Takes an optional interaction id to target a specific point, or uses the closest one the player has access to. ### Method Client Export ### Endpoint `exports['hex_jobscreator']:openCrafting(interactionId?)` ### Parameters #### Optional Parameters - **interactionId** (number) - Optional - The ID of the interaction point to open. If omitted, the closest accessible point is used. ### Request Example ```lua exports['hex_jobscreator']:openCrafting() ``` ### Response #### Success Response - **true** - Crafting menu opened. #### Error Response Returns `false, reason` where reason can be a shared resolve reason or one of the extra reasons below. #### Extra Reasons - **already_crafting** - A craft is already running. - **handcuffed** - Cuffed players cannot open this. - **no_recipes** - The point has no recipes configured. ``` -------------------------------- ### Server: Register 'dummy_full' interaction with all field types Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/custom-interactions/example Registers a custom interaction type 'dummy_full' using the 'hex_jobscreator' export. Includes fields: text, number, checkbox, select, color, itemlist, weaponlist, vehiclelist, and accountlist. Prints a success or error message based on the registration status. ```lua local status, errorMessage = exports['hex_jobscreator']:registerInteraction({ name = 'dummy_full', label = 'Dummy Full Showcase', data = { { name = 'title', label = 'Title', type = 'text', required = true, placeholder = 'Enter a title…', description = 'A short headline.', }, { name = 'amount', label = 'Amount', type = 'number', required = true, min = 1, max = 100, default = 10, description = 'How many? (1–100)', }, { name = 'enabled', label = 'Enabled', type = 'checkbox', default = true, description = 'Toggle this feature on or off.', }, { name = 'category', label = 'Category', type = 'select', required = true, options = { { value = 'alpha', label = 'Alpha' }, { value = 'beta', label = 'Beta' }, { value = 'gamma', label = 'Gamma' }, }, default = 'alpha', description = 'Pick a category.', }, { name = 'accent', label = 'Accent Colour', type = 'color', default = '#DB5A44', description = 'Choose a highlight colour.', hasColorPicker = true }, { name = 'wasd', label = 'Items', type = 'itemlist', hasPicker = true }, { name = 'guns', label = 'Weapons', type = 'weaponlist', hasPicker = true }, { name = 'vehicles', label = 'Vehicles', type = 'vehiclelist', hasPicker = true }, { name = 'money', label = 'Accounts', type = 'accountlist', hasPicker = true }, } }) if not status then print('^1[DUMMY] registerInteraction (full): ' .. tostring(errorMessage) .. '^7') else print('^2[DUMMY] Registered "dummy_full" successfully.^7') end ``` -------------------------------- ### showDutyHUD Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/duty-hud Un-hides the duty HUD. Idempotent calling it while the HUD is already visible is harmless. ```APIDOC ## showDutyHUD ### Description Un-hides the duty HUD. Idempotent calling it while the HUD is already visible is harmless. ### Method Client Export ### Endpoint `exports['hex_jobscreator']:showDutyHUD()` ### Parameters None ### Request Example ```lua local ok, err = exports['hex_jobscreator']:showDutyHUD() ``` ### Response #### Success Response - `true` - HUD un-hidden #### Error Response - `false, 'dutyhud_disabled'` - the duty HUD is switched off in the config ``` -------------------------------- ### openBillingMenu export call Source: https://docs.resync.me/docs/hexscripts/jobscreator/exports/client/billing Opens the job billing menu for the player's job with billing enabled and sufficient grade. Returns true on success, or false with a reason code (handcuffed, billing_disabled, grade_too_low, not_on_duty). Requires a thread. ```lua local ok, err = exports['hex_jobscreator']:openBillingMenu() ```