🇭🇰
Sleeping Dogs: DE (Script API)
  • Overview
  • ⛔Const
  • đŸ”ĸEnums
  • đŸ“ĻClasses
    • 🌈Color
    • 💾Config
    • 🚀Console
    • â˜¯ī¸Font
    • đŸ‘ŊHash
    • đŸ–ŧī¸Image
    • âŒ¨ī¸Input
    • đŸ‘ī¸Renderer
    • âŗTimer
    • 2ī¸âƒŖVector2
    • 3ī¸âƒŖVector3
  • đŸ—ƒī¸Game Classes
    • â„šī¸Overview
    • 🔊Audio
    • 📹Camera
    • đŸĢ‚CollisionData
    • 🎮GameInput
    • 🧩GameSlice
    • đŸ“ēHud
    • 📊Metrics
    • 📱PDA
    • 📈ProgressionTracker
    • 💡SimObject
    • 📮SimObjectProp
    • 🧍SimCharacter
    • 🚘SimVehicle
    • đŸ”ĢSimWeapon
    • â˜€ī¸TimeOfDayManager
  • 📩Callbacks
    • OnCollision
    • OnCharacterDeath
    • OnCharacterSpawn
    • OnGameUpdate
    • OnRender
    • OnUnload
    • OnVehicleDeath
Powered by GitBook
On this page
  • Examples:
  • Properties:
  • Static Functions:
  • Functions:
  • Attachment Functions:

Was this helpful?

  1. Game Classes

SimObject

General game-object.

Examples:

Objects Iteration:

for (local i = SimObject.GetHead(); i; i = i.GetNext())
{
    // Do something...
}

Properties:

Static Functions:

.Create

SimObject.Create(model: Hash, coords: Vector3, rotation: Vector3): SimObject

Argument
Type
Description

model

Hash

-

coords

Vector3

Position of new Object

rotation

Vector3

Rotation of new Object

Returns SimObject when successfully created.

.GetHead

SimObject.GetHead(): SimObject

Returns first SimObject in ObjectsTree.

.GetNext

SimObject.GetNext(): SimObject

Returns next SimObject from ObjectsTree.

Functions:

.SetDestroyOnUnload

SimObject.SetDestroyOnUnload(toggle: boolean)

Argument
Type
Description

toggle

boolean

-

You can toggle if the current SimObject should be destroyed when script gets unloaded.

When you create any SimObject by default it will be set to be destroyed on unload, but you can override it by calling this function with toggle value to false.

.Destroy

SimObject.Destroy()

Destroys a SimObject. Please note SimObject will not become null.

.Restore

SimObject.Restore()

Restores all suspended components.

.Suspend

SimObject.Suspend()

.GetName

SimObject.GetName(): Hash

Returns a SimObject name as hash.

.GetPropertyName

SimObject.GetPropertyName(): Hash

Returns a SimObject property name as hash, this is basically the model hash you use for creating SimObject.

.GetType

.GetPosition

SimObject.GetPosition(): Vector3

.SetPosition

SimObject.SetPosition(coords: Vector3)

Argument
Type
Description

coords

Vector3

World coordinates

.GetRotation

SimObject.GetRotation(): Vector3

.SetRotation

SimObject.SetRotation(euler: Vector3)

Argument
Type
Description

euler

Vector3

Rotation in euler

Attachment Functions:

.GetAttachmentCount

SimObject.GetAttachmentCount(): integer

Returns count of attached SimObjects to current SimObject.

.GetAttachments

SimObject.GetAttachments(): array[SimObject]

Returns array of SimObjects that are attached to current SimObject.

PreviousProgressionTrackerNextSimObjectProp

Last updated 1 year ago

Was this helpful?

Suspends all components. Note: some certain Objects will need to be suspend each .

SimObject:GetType():

đŸ—ƒī¸
💡
OnGameUpdate
SimObjectType