engineSetModelVisibleTime | Multi Theft Auto: Wiki Skip to content

engineSetModelVisibleTime

Client-side
Server-side
Shared

Pair: engineGetModelVisibleTime

This function changes model 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.setModelVisibleTime(...)

Syntax

bool engineSetModelVisibleTime ( ​string/int modelNameOrID, ​int timeOn, ​int timeOff )
Required Arguments
  • modelNameOrID: The model ID or name of the model.
  • timeOn: Value between 0 and 24 that states when the model should appear.
  • timeOff: Value between 0 and 24 that states when the model should disappear.

Returns

  • bool: result

Returns true if the change was successful, false otherwise.

Code Examples

client

Make Los Santos Tower visible only between 10 and 12 AM. Please keep in mind that this function does not affect collision - the building is still there, it's just invisible:

function init()
engineSetModelVisibleTime(4550, 10, 12)
end
addEventHandler ("onClientResourceStart", resourceRoot, init)

See Also

Engine Functions