TR/setElementData: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
|  (→Örnek) | |||
| (3 intermediate revisions by the same user not shown) | |||
| Line 19: | Line 19: | ||
| ==Örnek== | ==Örnek== | ||
| <section name="Client Taraflı" class="client" show="true"> | <section name="Client Taraflı" class="client" show="true"> | ||
| Bu Örnek  | Bu Örnek Oyuncudaki para miktarını kayıt etmektedir | ||
| <syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| setElementData(getLocalPlayer(), "paraVerisi", getPlayerMoney(getLocalPlayer())) | setElementData(getLocalPlayer(), "paraVerisi", getPlayerMoney(getLocalPlayer())) | ||
| </syntaxhighlight> | |||
| </section> | |||
| ==Örnek #2== | |||
| <section name="Client Taraflı" class="client" show="true"> | |||
| Bu Örnek Oyuncuya (Merhaba Dünya olarak) veri kayıt etmektedir | |||
| <syntaxhighlight lang="lua"> | |||
| setElementData(localPlayer, "paraVerisi", "Merhaba Dünya!") | |||
| </syntaxhighlight> | |||
| </section> | |||
| ==Örnek #3== | |||
| <section name="Server Taraflı" class="server" show="true"> | |||
| Bu Örnek Oyuncunun Girdiği yazıyı kayıt etmektedir. | |||
| <syntaxhighlight lang="lua"> | |||
| function komut(thePlayer, cmd, yazi) | |||
| setElementData(thePlayer, "paraVerisi", yazi) | |||
| outputChatBox(getElementData(thePlayer, "paraVerisi")) | |||
| end | |||
| addCommandHandler("yaziKaydet", komut) | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| </section> | </section> | ||
Latest revision as of 17:52, 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
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 | 
Örnek
Click to collapse [-]
Client TaraflıBu Örnek Oyuncudaki para miktarını kayıt etmektedir
setElementData(getLocalPlayer(), "paraVerisi", getPlayerMoney(getLocalPlayer()))
Örnek #2
Click to collapse [-]
Client TaraflıBu Örnek Oyuncuya (Merhaba Dünya olarak) veri kayıt etmektedir
setElementData(localPlayer, "paraVerisi", "Merhaba Dünya!")
Örnek #3
Click to collapse [-]
Server TaraflıBu Örnek Oyuncunun Girdiği yazıyı kayıt etmektedir.
function komut(thePlayer, cmd, yazi)
setElementData(thePlayer, "paraVerisi", yazi)
outputChatBox(getElementData(thePlayer, "paraVerisi"))
end
addCommandHandler("yaziKaydet", komut)