- Documentation
- Client functions
- setElementPreviewHeldOnly
Function
setElementPreviewHeldOnly
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.
enabledbooltrue= 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
createElementPreviewCreates a preview of an element (a vehicle, a player, a ped, an object, a model object) as an image fordxDrawImage, e.g. for a car shop or a wardrobe.falseas the target = the scene from the camera. By default the camera orbits the target so that it fits in the frame.setElementPreviewOrbitSets a camera orbiting the target: the horizontal angle (yaw, 0 = from the north), the vertical angle (pitch), the distance (0 = the whole target in frame), the height and the field of view.