dxDrawModel3D | Multi Theft Auto: Wiki Skip to content

dxDrawModel3D

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function draws a 3D model - rendered for one frame. Drawn models are indistinguishable from this one created by createObject function. This should be used in conjunction with onClientRender or onClientPreRender in order to display continuously. Note that a model must be loaded at the time this function is called. A model can be loaded and unloaded with the help of engineStreamingRequestModel and engineStreamingReleaseModel functions.

Important

You can not use this function to draw vehicles and ped

Important

This function doesn't obey any streaming limits, you can draw as many models as you want

Important

You can not render model to render target.

Syntax

dxDrawModel3D ( )

Code Examples

client

This example draws a model

local modelId = 1337
local function drawMyModel()
dxDrawModel3D(modelId, 0, 0, 4, 0, 0, 0)
end
local function startDraw()
engineStreamingRequestModel(modelId, true, true)
addEventHandler("onClientPreRender", root, drawMyModel)
end
local function stopDraw()
engineStreamingReleaseModel(modelId, true)
removeEventHandler("onClientPreRender", root, drawMyModel)
end