ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. addElementDataSubscriber

Function

addElementDataSubscriber

ServerElementsIdentical to MTA:SA

Subscribes a player to changes of one element data value. Works with values set in "subscribe" mode: only subscribed players receive them, which saves network traffic.

Syntax

bool addElementDataSubscriber(element theElement, string key, player thePlayer)

Arguments

theElementelement
The element holding the data.
keystring
The data key.
thePlayerplayer
The player who should receive the value.

Returns

true on success.

Example

Only the car owner sees its fuel level.

setElementData(vehicle, "fuel", 40, "subscribe")
addElementDataSubscriber(vehicle, "fuel", owner)

See also