ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. setElementPreviewModel

Function

setElementPreviewModel

ClientGame engineTrilogy Hub only

Sets a model preview without an element in the world (e.g. a list of cars or skins in a shop): the kind ("vehicle", "ped", "object") and the model number. The model only exists for this player, for the shots.

Syntax

bool setElementPreviewModel(preview preview, string kind, int model)

Arguments

previewpreview
The preview.
kindstring
"vehicle", "ped" or "object".
modelint
Model number.

Returns

true on success.

Example

A car shop: the preview changes when you click a model on the list.

local preview = createElementPreview(false, 400, 250)
local function showCar(model)
    setElementPreviewModel(preview, "vehicle", model)
end
showCar(411)

See also