GetEntityData: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "Gets entity data that was set with SetEntityData. Note that this data is in a different state than synced data that you set with SetEntitySharedData. To get synced da...")
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Gets entity data that was set with [[SetEntityData]].
Gets entity data that was set with SetEntityData.


Note that this data is in a different state than synced data that you set with [[SetEntitySharedData]]. To get synced data, use [[GetEntitySharedData]] instead.
Note that this data is in a different state than synced data that you set with SetEntitySharedData. To get synced data, use GetEntitySharedData instead.


==Syntax==
==Syntax==
<syntaxhighlight lang="C#" >dynamic NAPI.Data.GetEntityData(NetHandle entity, string key);</syntaxhighlight>
<syntaxhighlight lang="C#" >dynamic NAPI.Data.GetEntityData(Entity entity, string key);</syntaxhighlight>


'''Required Arguments'''
'''Required Arguments'''
*'''entity:''' parameter input should be in '''NetHandle''' type.
*'''entity:''' parameter input should be in '''Entity''' type.
*'''key:''' parameter input should be in '''string''' type.
*'''key:''' parameter input should be in '''string''' type.



Latest revision as of 19:33, 22 December 2022

Gets entity data that was set with SetEntityData.

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

Syntax

dynamic NAPI.Data.GetEntityData(Entity entity, string key);

Required Arguments

  • entity: parameter input should be in Entity 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 = NAPI.Data.GetEntityData(player, "Jailtime");