Examples and troubleshooting
All examples change config.lua in the ares_electrician folder. Restart the resource after every change:
restart ares_electricianExample configurations
Section titled “Example configurations”Solo job only
Section titled “Solo job only”Allow lobbies of one player. Dispatch then only offers sites made for one player.
Config.MaxPlayers = 1Raise the pay of harder jobs
Section titled “Raise the pay of harder jobs”Edit the multipliers inside Config.Dispatch:
difficultyMultipliers = { easy = 1.0, medium = 2.0, hard = 3.0, expert = 4.0},A hard site with basePay = 800 now pays 2400 for the lobby. The same multiplier also scales XP, so a hard job gives 300 XP with the default defaultXPPerJob = 100.
Give items when the job starts
Section titled “Give items when the job starts”Config.JobItems = { {item = 'water', count = 1}, {item = 'sandwich', count = 3}}The items are removed when the player ends the job or leaves the lobby. The item names go through Config.InventoryAliases, so water becomes water_bottle on qb-inventory.
Spawn the work van at your own location
Section titled “Spawn the work van at your own location”customSpawnCoords = { vector3(299.9698, -449.0337, 43.5865), vector3(300.0, -450.0, 43.5)},Keep useCustomSpawnForFirstVehicleOnly = true.
Turn leveling off
Section titled “Turn leveling off”Config.Leveling.enabled = falseNo XP is given and no pay bonus is applied. Pay is the plain site pay.
Level up faster
Section titled “Level up faster”At the default settings a medium job gives 150 XP and a hard job gives 200 XP. Level 3 needs 1500 XP, which is about 10 medium jobs. Two ways to speed this up:
defaultXPPerJob = 300,or lower the xpRequired values in Config.leveling.levels.
Make the default marker visible
Section titled “Make the default marker visible”The opacity value a is 0 to 255. Change it from 0.8 to 200:
color = {r = 37, g = 87, b = 35, a = 200},Move the job center
Section titled “Move the job center”Config.JobCenter = { coords = vector3(100.0, 200.0, 30.0), -- replace with your coordinates radius = 2.0, blip = { sprite = 408, color = 3, scale = 0.8, name = "Electrician Job Center" }}Edge cases
Section titled “Edge cases”Vehicle keys
Section titled “Vehicle keys”When the work van spawns, the host’s game triggers the client event vehiclekeys:client:SetOwner with the van’s plate. qb-vehiclekeys and key resources that copy it listen to this event, so they work without extra setup.
-
Another key resource: add a small listener in your own resource (client side) that gives the key in your system. Use the real export of your key resource:
RegisterNetEvent('vehiclekeys:client:SetOwner', function(plate)exports['my_keys']:GiveKeyByPlate(plate)end)Do not add this if your key resource already listens to the same event, or the player gets the key twice.
-
No keys on your server, or keys handled elsewhere: set
Config.WorkVan.giveKeys.enabled = false. -
Only the host gets the keys. If your key resource needs a key to start the engine, the partner needs a key from the host. Use the key sharing feature of your key resource.
Multiplayer lobbies
Section titled “Multiplayer lobbies”- The player who opens the lobby is the host. Only the host presses Start Job and takes the job offer.
- A lobby holds
Config.MaxPlayersplayers (default 2). - Every lobby member gets the waypoint and the blip for the site.
- A lobby with 1 player only gets sites for 1 player. A lobby with 2 players only gets sites with
minPlayers = 2andmaxPlayers = 2. If you raiseConfig.MaxPlayersabove 2, also add sites that accept that lobby size, or those lobbies get no offers. - The pay of a job is shared equally between the lobby members. Each player’s level bonus is applied to their share.
- Every lobby member gets XP.
- Any lobby member can start the repair at the site.
- When a player leaves the lobby, their job items are removed and their map blips are cleared.
Rerolls
Section titled “Rerolls”- Reroll asks dispatch for another random job from the matching sites. If only one site matches, you may get the same one again.
- The reroll limit is off by default (
enableRerollLimit = false). - When you turn it on, the counter goes up each time the player accepts a job and returns to 0 when a job is completed. In version 1.2.2 presses of the Reroll button are not counted. Test your values before you use the limit on a live server.
- Never turn the limit on with
maxRerolls = 0. That blocks every job offer.
Inventory item name aliases
Section titled “Inventory item name aliases”- Use one logical item name in
Config.JobItemsand map it per inventory inConfig.InventoryAliases. - If an item has no alias entry for your inventory, the name is used unchanged.
- If the item name does not exist in your inventory, the player does not receive it. Turn on
Config.Debugto see the failed attempt in the console. - Giving and removing items needs a detected inventory. On QBCore and QBox the framework’s own item functions are used when no inventory is detected. On ESX nothing is given.
Work van swap and full parking
Section titled “Work van swap and full parking”Sometimes the lobby resource asks the players to swap the work van. The players see a notification such as “Drive to the marked place and park inside the highlighted zone”. They park the van in the zone and everyone gets out. The van is replaced and the job continues.
If the parking area is full or the van cannot be created, the host sees a message and can try again after a moment. If you use customSpawnCoords, make sure the position is free and that the value is a table of vector3.
Failed jobs
Section titled “Failed jobs”If a player closes a minigame before finishing it, or fails it, the job counts as failed. The lobby is paid a reduced amount and gets less XP.
Destroyed work vans
Section titled “Destroyed work vans”If every work van of the lobby is destroyed, the job ends.
XP and characters
Section titled “XP and characters”XP is stored per player, not per character. All characters of one player share the same XP and level.
Troubleshooting
Section titled “Troubleshooting”| Problem | Likely cause | Fix |
|---|---|---|
| The console says the resource folder name is wrong | The folder is not called ares_electrician |
Rename it to exactly ares_electrician and restart the server. |
| The resource does not start and a dependency is missing | ares-core or ox_lib is not installed or not started |
Install them and start them before ares_electrician. Keep the folder name ares-core. |
| The console reports that no supported framework was found | The framework is not started before the job, or its resource name is different | Start es_extended, qb-core or qbx-core first. Set Config.Framework to 'esx' or 'qb-core' if auto-detection fails. |
| There is no target option at the job center | No target resource is running, or it starts after the job | Start ox_target or qb-target before ares_electrician. Set Config.Target. Turn on Config.Debug to see the zone. |
| The lobby window does not open or the job does not start | ares-core is not running |
Check that ares-core is started and has no errors. |
| “No jobs available” appears | No site is in range, no site matches the lobby size, or all sites were removed | Increase Config.Dispatch.maxDistance, check minPlayers and maxPlayers of the sites, or add sites. |
| A lobby of 2 never gets a job | Only sites with minPlayers = 2 and maxPlayers = 2 are offered to 2 players |
Add sites for 2 players. See Job sites. |
| XP is not saved or the console shows database errors | The SQL file was not imported, or oxmysql is not running |
Import the SQL file shipped with the resource and start oxmysql. |
| The marker is not visible | The default opacity a = 0.8 is almost transparent |
Use a = 200. |
| The language did not change | The language code does not match a file in shared/lang, or the JSON is invalid |
Check the file name, check the JSON for missing commas or quotes, and restart. The script falls back to English. |
| Some texts stay in English | Those texts are not read from the language files | See Language files. |
| Players do not get keys | Your key resource does not listen to vehiclekeys:client:SetOwner |
Add a listener as shown in the vehicle keys section above. |
| Custom notifications do not show | Config.Notification is not 'custom', or the code in notify.lua is incomplete |
See Framework adapter. |
| Job items are not given | The item does not exist, or no inventory is detected | Check the item name, Config.InventoryAliases and Config.Inventory. |
| The work van does not appear | The parking area is full, or customSpawnCoords is wrong |
Wait and try again. Check that customSpawnCoords is a table of vector3 and that the position is free. |
For anything else, set Config.Debug = true, repeat the problem and read the server and client consoles. Set it back to false afterwards.
