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

Function

setElementPreviewHeldOnly

ClientGame engineTrilogy Hub only

A ped preview shows only what the ped holds in its hand (a weapon), without the body. The camera orbits the item alone, e.g. in a gun shop.

Syntax

bool setElementPreviewHeldOnly(preview preview, bool enabled)

Arguments

previewpreview
A preview targeting a ped.
enabledbool
true = the item only.

Returns

true on success.

Example

A gun shop: a ped holding the weapon, the preview shows only the weapon.

local preview = createElementPreview(shopPed, 256, 256)
setElementPreviewHeldOnly(preview, true)
setElementPreviewOrbit(preview, 0, 15)

Notes

While the ped holds nothing, the preview state is "czeka na cel".

See also