๐ ๏ธ Configuration
Shared Configuration (configs/shared.lua)
Debug Configuration
Controls debug output for the truck robbery system.
Lua
Shared.Debug = {
Enabled = true, -- Set to false to disable all debug prints
Levels = {
Info = true, -- General information
Success = true, -- Success operations
Warning = true -- Warning and potential issues
}
}- Enabled: Enables/disables all debug prints.
- Levels: Controls specific debug message types.
- Info: General information about system operations
- Success: Successful operation confirmations
- Warning: Warning messages and potential issues
Client Configuration (configs/client.lua)
Truck Spawn Locations
Defines where mission trucks will spawn on the map.
Lua
Config.TruckSpawnCoords = {
vec4(-271.2736, 6069.4941, 31.0700, 124.1105),
}- TruckSpawnCoords: Array of vec4 coordinates (x, y, z, heading) where trucks can spawn.
- Format:
vec4(x, y, z, heading) - Usage: Add more coordinates to create multiple possible spawn points for variety.
Destination Coordinates
Defines where players must deliver the stolen truck.
Lua
Config.DesitnationCoords = {
vec4(1576.2224, 6449.6060, 24.8902, 274.0559)
}- DesitnationCoords: Array of vec4 coordinates for delivery locations.
- Format:
vec4(x, y, z, heading) - Note: Multiple destinations can be added for variety.
Ped Models
Defines the peds models that can be used for NPCs in the mission.
Lua
Config.PedModels = {
"mp_m_freemode_01",
"mp_f_freemode_01",
}- PedModels: Array of ped model names to use for mission NPCs.
- Default Models:
mp_m_freemode_01: Male freemode pedmp_f_freemode_01: Female freemode ped
- Customization: Add more ped models to increase NPC variety.
Server Configuration (configs/server.lua)
Alarm Triggering Function
Custom function to handle alarm triggering during the robbery.
Lua
function TriggerAlarm(coords)
-- TODO Implement alarm triggering logic
-- Example: Notify police, trigger dispatch, etc.
end- coords: The coordinates where the alarm was triggered.
- Usage: Customize this function to integrate with your police/dispatch system.
- Implementation Examples:
- Send notification to police players
- Create a blip on the map
- Trigger a dispatch call
- Send alert to specific job roles
Translation Configuration (configs/translation.lua)
Customize all user-facing text in the resource.
Lua
Shared.Lang = {
["weight_too_heavy"] = "Weight is too heavy for you, you need to unlock the skill first",
}- Modify these strings to change the language or customize messages.
- Add your own language translations by following the same format.
- Example: For Polish translation, replace English text with Polish equivalents.
Customization
Adding More Spawn Points
Add additional truck spawn locations for variety:
Lua
Config.TruckSpawnCoords = {
vec4(-271.2736, 6069.4941, 31.0700, 124.1105),
vec4(-500.1234, 5800.5678, 32.1500, 90.0000), -- New spawn point
vec4(-150.9876, 6200.3456, 30.5000, 180.0000), -- Another spawn point
}Adding More Delivery Locations
Create multiple delivery destinations:
Lua
Config.DesitnationCoords = {
vec4(1576.2224, 6449.6060, 24.8902, 274.0559),
vec4(1200.5678, 6300.1234, 25.5000, 180.0000), -- New destination
}Customizing NPC Appearance
Add more diverse ped models:
Lua
Config.PedModels = {
"mp_m_freemode_01",
"mp_f_freemode_01",
"s_m_m_armoured_01", -- Security guard
"s_m_m_autoshop_01", -- Mechanic
"a_m_m_business_01", -- Business person
}Implementing Custom Alarm System
Example implementation for the TriggerAlarm() function:
Lua
function TriggerAlarm(coords)
-- Notify all online police officers
local xPlayers = ESX.GetExtendedPlayers('job', 'police')
for _, xPlayer in pairs(xPlayers) do
xPlayer.showNotification('Truck robbery in progress!')
-- Create a blip on the map
TriggerClientEvent('devhub_truckRobbery:createAlarmBlip', xPlayer.source, coords)
end
-- Send to dispatch system (example)
-- TriggerEvent('your_dispatch:sendAlert', {
-- coords = coords,
-- type = 'truck_robbery',
-- message = 'Truck robbery in progress'
-- })
endTroubleshooting
Truck not spawning:
- Verify
Config.TruckSpawnCoordscontains valid coordinates - Check that the spawn area is clear of obstructions
- Enable debug mode to see spawn-related messages
- Ensure truck model is properly loaded
Delivery location not working:
- Check
Config.DesitnationCoordscoordinates are accessible - Verify the delivery zone trigger radius
- Test coordinates in-game to ensure they're valid
NPCs not appearing:
- Verify ped models in
Config.PedModelsare valid - Ensure ped models are streamed properly
- Try using default GTA V ped models first
Alarms not triggering:
- Implement the
TriggerAlarm()function inserver.lua - Verify your dispatch/police notification system is active
- Check server console for Lua errors
- Test the function with debug prints
Debug Mode: Enable comprehensive debugging:
Lua
Shared.Debug = {
Enabled = true,
Levels = {
Info = true,
Success = true,
Warning = true
}
}