engineGetModelVisibleTime | Multi Theft Auto: Wiki Skip to content

engineGetModelVisibleTime

Client-side
Server-side
Shared

Pair: engineSetModelVisibleTime

This function returns a model's visibility time, this is used for example for building lights being shown after 23:00.

OOP Syntax Help! I don't understand this!

  • Method:Engine.getModelVisibleTime(...)

Syntax

int, ​int engineGetModelVisibleTime ( ​string/int modelNameOrID )
Required Arguments
  • modelNameOrID: The model ID or name of the model.

Returns

  • int: timeOn
  • int: timeOff

Returns 2 integers, indicating timeOn and timeOff. Returns false if invalid model provided.

Code Examples

client

Make Los Santos Tower visible only between 10 and 12 AM.

function init()
engineSetModelVisibleTime(4550, 10, 12)
local timeOn, timeOff = engineGetModelVisibleTime(4550)
outputChatBox("Los Santos Tower visible time is now between " .. timeOn .. " and " .. timeOff)
end
addEventHandler("onClientResourceStart", resourceRoot, init)

See Also

Engine Functions