Page cover

⚙️Configuration

This guide covers the configurable options for the NeedForScripts Customs Script and provides

Configurable Options

The main configuration file is config.lua. Here are the key aspects you can modify:

  1. Prices: Adjust the costs for various customization options.

  2. Categories: Modify the available customization categories to suit your server's needs.

  3. Images: Set custom images for different parts of the user interface.

  4. Camera Angles: Configure camera positions for various customization views.

  5. Tuner Shop Locations: Set the locations where players can access the customization features.

  6. Blips: Adjust settings for map blips, including whether to display them.

  7. Job Restrictions: Configure which jobs are allowed to access the customization features.

  8. Translations: Customize text displayed in the script to support multiple languages.

For detailed information on how to adjust these settings, please refer to the comments in the config.lua file.

Understanding The Config File

This guide covers the main config file for setting up shop locations and access restrictions. For customizing prices, categories, colors, decals, and other modification options, please refer to the other config files in the data folder (categories.lua, colors.lua, decals.lua, etc.).

return {
    -- ==========================================
    -- LOCATIONS SECTION
    -- ==========================================
    -- Define all your tuner shop locations here
    locations = {
        
        -- EXAMPLE 1: PUBLIC SHOP WITH RESTRICTIONS
        {
            -- Shop coordinates (x, y, z, heading)
            pos = vector4(729.65, -1088.95, 21.5, 89.94),
            
            -- Map blip settings (OPTIONAL - remove entire 'blip' section to hide from map)
            blip = { 
                sprite = 72,        -- Icon type (72 = garage icon)
                color = 7,          -- Icon color (7 = yellow)
                scale = 0.7,        -- Icon size
                shortRange = true,  -- Only visible when nearby
                label = 'Customs'   -- Name on map
            },
            
            -- Restrict which modifications can be done (OPTIONAL)
            mods = {'decals', 'paint'}, -- Only decals and paint available
            
            -- Make modifications free (OPTIONAL)
            free = true, -- Set to false or remove for paid modifications
            
            -- Restrict vehicle classes (OPTIONAL)
            classes = { 2, 5 }, -- Only SUVs (2) and Sports Classics (5)
            -- Common vehicle classes:
            -- 0 = Compacts, 1 = Sedans, 2 = SUVs, 3 = Coupes
            -- 4 = Muscle, 5 = Sports Classics, 6 = Sports
            -- 7 = Super, 8 = Motorcycles, 9 = Off-road
            -- 10 = Industrial, 11 = Utility, 12 = Vans
            
            -- Job/Group restriction (OPTIONAL - COMMENTED OUT)
            -- Uncomment to restrict access to specific jobs
            -- group = {
            --     mechanic = 0 -- Only 'mechanic' job with grade 0+ can access
            -- },
        },
        
        -- EXAMPLE 2: JOB-RESTRICTED SHOP
        {
            pos = vector4(-211.87, -1324.59, 30.22, 153.12),
            blip = { 
                sprite = 72, 
                color = 7,
                scale = 0.7, 
                shortRange = true, 
                label = 'Bennys Motorworks' 
            },
            -- Only mechanics and lscustoms jobs can use this shop
            group = { 
              mechanic = 0,
              lscustoms = 0, 
            } -- mechanic job, grade 0 or higher
        },
        
        -- EXAMPLE 3: POLICE-ONLY SHOP (NO MAP BLIP)
        {
            pos = vector4(457.12, -1019.44, 27.61, 89.59),
            -- No blip = hidden from map
            group = { police = 0 } -- Only police can access
        },
        
        -- EXAMPLE 4: PUBLIC SHOP (EVERYONE CAN ACCESS)
        -- To make a shop public, simply DON'T include the 'group' parameter
        {
            pos = vector4(110.8, 6626.46, 31.89, 90.0),
            blip = { 
                sprite = 72, 
                color = 7,
                scale = 0.7, 
                shortRange = true, 
                label = 'Customs' 
            }
            -- NO 'group' line = accessible by everyone!
        },
        
        -- Additional locations follow the same pattern...
        {
            pos = vector4(1695.14, 3588.98, 35.29, 90.0),
            blip = { sprite = 72, color = 7,scale = 0.7, shortRange = true, label = 'Customs' },
            group = { mechanic = 0 }
        },
        {
            pos =  vector4(-1155.45, -2006.01, 12.51, 146.29),
            blip = { sprite = 72, color = 7,scale = 0.7, shortRange = true, label = 'Customs' },
            group = { mechanic = 0 }
        },
        {
            pos =  vector4(-338.16, -136.74, 38.34, 269.75),
            blip = { sprite = 72, color = 7,scale = 0.7, shortRange = true, label = 'Customs' },
            group = { mechanic = 0 }
        },
        {
            pos =  vector4(1175.38, 2640.37, 37.09, 308.77),
            blip = { sprite = 72, color = 7,scale = 0.7, shortRange = true, label = 'Customs' },
            group = { mechanic = 0 }
        },
    },
    
    -- ==========================================
    -- ECONOMIC SETTINGS
    -- ==========================================
    
    -- Repair cost multiplier (0.5 = 50% of base cost)
    repairMultiplier = 0.5,
    
    -- Where money is deducted from:
    -- 'player' = deduct from player's pocket
    -- 'society' = deduct from job/society account
    deductType = 'player',
    
    -- Commission percentage for mechanics (if applicable)
    -- 10 = mechanic gets 10% of the transaction
    commissionPercentage = 10
}

--[[
    ==========================================
    QUICK FAQ FOR CUSTOMERS
    ==========================================
    
    Q: How do I make a shop accessible to EVERYONE?
    A: Remove or comment out the "group = { ... }" line
    
    Q: How do I hide a shop from the map?
    A: Remove the entire "blip = { ... }" section
    
    Q: How do I restrict to multiple jobs?
    A: group = { mechanic = 0, police = 0 } -- Both jobs can access
    
    Q: How do I make modifications free?
    A: Add "free = true" to the location
    
    Q: How do I limit which mods are available?
    A: Add "mods = {'paint', 'wheels', 'engine'}" etc.
    
    Q: What vehicle classes can I restrict?
    A: Use "classes = {0, 1, 2, ...}" with class IDs listed above
    
    Q: Can I have different grade requirements?
    A: Yes! group = { mechanic = 2 } means only grade 2+ mechanics
    
    ==========================================
]]

Events

Client Event

AddEventHandler('nfs-customs:client:customsToggle', function(show)
    -- Your code here
end)

This event is triggered when the customs UI is opened or closed. The show parameter is a boolean indicating if the UI is being shown (true) or hidden (false).

Server Event

RegisterNetEvent('nfs-customs:server:customsToggle', function(show)
    -- Your code here
end)

This event is triggered on the server when a player opens or closes the customs UI. The show parameter works the same as in the client event.

Exports

toggleCustoms

exports['nfs-customs']:toggleCustoms(show)

Use this export to programmatically open or close the customs UI.

  • show: boolean - Set to true to open the UI, false to close it.

Get specified vehicle stancers

local data = exports['nfs-customs']:getVehicleStancers(vehicleEntity)

Set specified vehicle stancers

exports['nfs-customs']:setVehicleStancers(vehicleEntity, data)

Integration Tips

  1. Use the provided events to sync other scripts with the customs UI state.

  2. Adjust job restrictions to integrate with your server's job system.

  3. Customize blip settings to match your server's map style.

  4. Use translations to support multiple languages on your server.

Remember to restart your server after making changes to the configuration file.

For more detailed information on each configuration option, please refer to the comments in the config.lua file.

Last updated