🎉 %50 DISCOUNT 🎉 %50 DISCOUNT 🎉 %50 DISCOUNT 🎉 %50 DISCOUNT 🎉 %50 DISCOUNT
← Back to Products
VEHICLE IMAGES [QB/QBox/ESX ] [OPENSOURCE]

VEHICLE IMAGES [QB/QBox/ESX ]

ESX QBCore QBox

This item is free.

Add to Cart
Performance certified by stress tests 24/7 Always-on customer support
Documentation

# PARVA Vehicle Images

This resource exports images from the `images/` folder to other scripts.

## Installation

1. Add the resource to your server.cfg file:

```

ensure parva_vehicleimages

```

2. Add your images to the `images/` folder (png, jpg, jpeg formats)

## Usage

### Export Functions

#### `GetImagePath(imageName)`

Returns the NUI URL path of the image. Ideal for use in HTML/NUI.

```lua

local imageUrl = exports['parva_vehicleimages']:GetImagePath('vehicle1')

-- Returns: "nui://parva_vehicleimages/images/vehicle1.png"

```

#### `GetImage(imageName)`

Returns image information as an object.

```lua

local imageData = exports['parva_vehicleimages']:GetImage('vehicle1')

-- Returns: {name = "vehicle1", path = "nui://...", url = "nui://..."}

```

#### `ImageExists(imageName)`

Checks if the image exists.

```lua

local exists = exports['parva_vehicleimages']:ImageExists('vehicle1')

if exists then

    print("Image exists!")

end

```

#### `GetAllImages()`

Returns a list of all images.

```lua

local images = exports['parva_vehicleimages']:GetAllImages()

```

## Usage Examples

### Displaying Images in NUI/HTML

```lua

-- Client-side

local imageUrl = exports['parva_vehicleimages']:GetImagePath('my_vehicle')

SendNUIMessage({

    type = "displayImage",

    imageUrl = imageUrl

})

```

```html

<!-- In HTML -->

<img src="<imageUrl>" alt="Vehicle Image">

```

### Simple Usage

```lua

-- You can use without file extension (defaults to .png)

local img1 = exports['parva_vehicleimages']:GetImagePath('vehicle1')

-- With full filename

local img2 = exports['parva_vehicleimages']:GetImagePath('vehicle2.jpg')

```

## Notes

- If you don't specify a file extension, it defaults to `.png`

- Supported formats: `.png`, `.jpg`, `.jpeg` (case-sensitive)

- Images are returned in `nui://` URL format, so they can be used directly in HTML/NUI

Top Customer

Trusted by thousands of customers with successful sales worldwide.

Recent Payments

Real feedback from our community after installing and using our FiveM resources.

Join our Discord

Get support, updates, and community tips for our resources.

Discord