ConfigurationAdvanced

Images

Learn how to configure the images for interiors.

Image API

The image API fetches images from an external source and displays them in the UI. This can be useful for displaying images of items, locations, or other content in your resource.

Change API

  1. Open the config.lua file in the resource folder.
  2. Locate the Config.ImageAPI table.
  3. Modify the values to your preferred settings.
Config.ImageAPI = {
    url = function(modelHash, modelName, modelLabel)
        return 'https://example.com/images/' .. modelHash .. '.png'
    end,
    callback = function(result)
        return result.image -- The image URL
    end
}
  1. Replace the URL in the url function with your image source. You can use placeholders like modelHash, modelName, and modelLabel to customize the URL.
  2. Update the callback function to return the image URL from the result object.
  3. Save the file and restart the resource.

Vehicle Images

The resource also allows you to specify image URLs for vehicles.

Set Vehicle Image

  1. Open the config.lua file in the resource folder.
  2. Locate the Config.Images table.
  3. Add a new entry in the table, structured as follows:
Config.Images = {
    ...
    -- Add a new vehicle image entry here
    ['vehicle_model'] = 'https://example.com/images/vehicle_model.png'
}
  1. Replace 'vehicle_model' with the model name of the vehicle.
  2. Replace the URL with the image source for the vehicle.
  3. Save the file and restart the resource.

On this page