TR/setElementData: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 1: Line 1:
==Syntax==  
==Syntax==  
<section show="true" name="Server" class="server">
<syntaxhighlight lang="lua">int/bool getPlayerMoney ( player veya thePlayer )</syntaxhighlight>
{{OOP||[[player]]:getMoney|money|setPlayerMoney}}
</section>


<section show="true" name="Client" class="client">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">int getPlayerMoney (getLocalPlayer() veya localPlayer)</syntaxhighlight>  
bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )
{{OOP||[[Player]].getMoney||setPlayerMoney}}
</syntaxhighlight>  
</section>
{{OOP||[[element]]:setData||getElementData}}
 
===Required Arguments===
*'''theElement:''' The [[element]] you wish to attach the data to.
*'''key:''' The key you wish to store the data under. (Maximum 31 characters.)
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.
 
===Optional Arguments===
*'''synchronize:''' Determines whether or not the data will be synchronized with the server (client-side variation) and remote clients (both variations).
 
===Returns===
Returns ''true'' if the data was set succesfully, ''false'' otherwise.
 
===Issues===
{{Issues|
{{Issue|7389|[Fixed in 1.3.5-7389] Problem with floating numbers}}
}}


==Example==
==Example==

Revision as of 17:11, 21 May 2017

Syntax

bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )

OOP Syntax Help! I don't understand this!

Method: element:setData(...)
Counterpart: getElementData


Required Arguments

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

Optional Arguments

  • synchronize: Determines whether or not the data will be synchronized with the server (client-side variation) and remote clients (both variations).

Returns

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

Issues

Issue ID Description
#7389 [Fixed in 1.3.5-7389] Problem with floating numbers

Example