element.ref: Difference between revisions

(Created page with "{{ScriptItem |endpoint = client |type = property |class = Element |name = ref |returnTypes = int |readonly = true |usage = gets the internal GTA reference ID of the element |returnInfo = the internal GTA reference ID of the element |notes = This is NOT the GTAC element ID!<br>The ref ID here is used in GTA natives for GTA 3, Vice City, and San Andreas |exampleJSCS = addComma...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
|usage = gets the internal GTA reference ID of the element
|usage = gets the internal GTA reference ID of the element
|returnInfo = the internal GTA reference ID of the element
|returnInfo = the internal GTA reference ID of the element
|notes = This is NOT the GTAC [[element.id|element ID]]!<br>The ref ID here is used in GTA natives for [[Resources/Natives/GTA3|GTA 3]], [[Resources/Natives/GTAVC|Vice City]], and [[Resources/Natives/GTASA|San Andreas]]
|notes = This is NOT the GTAC [[element.id|element ID]]!<br>The ref ID here is used in GTA natives for [[Client/Natives/III|GTA 3]], [[Client/Natives/VC|Vice City]], and [[Client/Natives/SA|San Andreas]]
|exampleJSCS = addCommandHandler("taxilight", (command, params) => {  
|exampleJSCS = addCommandHandler("taxilight", (command, params) => {  
     natives.SET_TAXI_LIGHT(localPlayer.vehicle.ref, 1)  
     natives.SET_TAXI_LIGHT(localPlayer.vehicle.ref, 1)  
});
});
}}
}}

Latest revision as of 00:37, 4 January 2026

Property Client Only icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline Read-Only

Available since Client 1.0.0
int element.ref
The element.ref property is used to gets the internal GTA reference ID of the element.

Value

int The internal GTA reference ID of the element.
readonly This property cannot be changed.

Types

Shared Blip
Shared Building
Shared Element
Shared Entity
Shared Marker
Shared Object
Shared Ped
Shared Physical
Shared Player
Shared Vehicle

Notes

Examples

Example 1 - JavaScript - Client-Side:

addCommandHandler("taxilight", (command, params) => { 
    natives.SET_TAXI_LIGHT(localPlayer.vehicle.ref, 1) 
});

Compatibility

There isn't any compatibility information for this property.

Related

Client Related

        destroyElement
      getElementCount
        getElementFromId
        getElementFromName
      getElements
        getElementsByType

        element.children
        element.clearExistsFor
        element.dimension
        element.existsFor
        element.getData
        element.getRotation
        element.id
        element.isCreatedFor
        element.isLocal
        element.isOwner
        element.isSyncer
        element.isType
        element.name
        element.netFlags
        element.parent
        element.position
        element.removeAllData
        element.removeData
        element.resource
        element.rotation
        element.setData
        element.setExistsFor
        element.setRotation
        element.setSyncer
        element.streamInDistance
        element.streamOutDistance
        element.syncer
        element.syncerId
        element.type