SetEntitySyncedData

From GT-MP
Jump to: navigation, search
SetEntitySyncedData
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

Sets the given data value for the given entity and synchronizes this value to clients. Use setEntityData if the data should only exist on the server and shouldn't be synchronized. Check the Synchronized Types for which types you can synchronize with this.

Note: In order to be able to do this from the client side, you have to set trust_client_entity_properties to true in the server's settings.xml.

Syntax

API.setEntitySyncedData(NetHandle entity, string key, object value);

Required Arguments

  • entity: parameter input should be in NetHandle type.
  • key: parameter input should be in string type.
  • value: parameter input should be in object type.

NOTE: This function returns data in bool type.

Usage example(s)

Example Description

API.setEntitySyncedData(NetHandle entity, string key, object value);

References