GetEntityData

From GT-MP
Jump to: navigation, search
GetEntityData
Server-Side Function
Utilities-terminal.png Server-Side Csharp.png C#

Gets entity data that was set with setEntityData.


Note that this data is in a different state than synced data that you set with setEntitySyncedData. To get synced data, use getEntitySyncedData instead.

Syntax

API.getEntityData(NetHandle entity, string key);

Required Arguments

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

NOTE: This function returns data in dynamic type.

Usage example(s)

// Note: Since the return type is dynamic, this will throw an exception if the data is not of type int!
int jailtime = API.getEntityData(player, "Jailtime");

OOP:

// Note: Since the return type is dynamic, this will throw an exception if the data is not of type int!
int jailtime = player.getData("Jailtime");

Changelog

Version Description
1.0 Release.

References