SetElementData: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Linked to element data)
Line 1: Line 1:
{{Server client function}}
{{Server client function}}
__NOTOC__  
__NOTOC__  
This function stores data attached to an element. This data can be any primitive LUA type or MTA element (but not a text item or display).
This function stores [[element data]] attached to an element.
 
Element data is a useful way to store data attached to players.


==Syntax==  
==Syntax==  
Line 11: Line 9:


===Required Arguments===  
===Required Arguments===  
*'''theElement:''' The element you wish to attach the data to
*'''theElement:''' The [[element]] you wish to attach the data to.
*'''key:''' The key you wish to store the data under
*'''key:''' The key you wish to store the data under.
*'''value:''' The value you wish to store
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.


===Returns===
===Returns===

Revision as of 15:08, 30 August 2007

This function stores element data attached to an element.

Syntax

bool setElementData ( element theElement, string key, var value ) 

Required Arguments

  • theElement: The element you wish to attach the data to.
  • key: The key you wish to store the data under.
  • value: The value you wish to store. See element data for a list of acceptable datatypes.

Returns

Returns true if the data was set succesfully, false otherwise.

Example

Click to expand [+]
Server

See Also