OnElementDataChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
This fake function is for use with blah & blah and does blahblahblabhalbhl
{{Server event}}
This event is triggered when an elementdata entry for an element changes. A client can perform this change on the element or it can be done using [[setElementData]].


This event will be triggered when someone joins the server
==Parameters==
<syntaxhighlight lang="lua">
string theName, var theOldValue
</syntaxhighlight>
 
*'''theName''': The name of the element data entry that changed
*'''theOldValue''': The old value of this entry before it changed. The new one can be accessed through [[getElementData]] ( theName ).


==Example==
==Source==
This example gets the joining client's name and outputs a welcome message including his name once he joins
The [[event system#Event source|source]] of this event is the [[element]] whose elementdata changed.


==Example==
<!-- Explain what the example is in a single sentance -->
This example does...
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
 
--This line does...
addEventHandler ( "onPlayerJoin", root, "onPlayerJoin" )
blah()
function onPlayerJoin ( )
--This line does this...
joinplayer = getClientName ( source )
mooo
outputChatBox ( "Welcome " ..joinplayer.. " to the Server!" , source, 255, 255, 255 )
end
 
</syntaxhighlight>
</syntaxhighlight>


[[Category: Incomplete Event]]
[[Category:Needs Example]]

Revision as of 04:32, 30 December 2007

This event is triggered when an elementdata entry for an element changes. A client can perform this change on the element or it can be done using setElementData.

Parameters

string theName, var theOldValue
  • theName: The name of the element data entry that changed
  • theOldValue: The old value of this entry before it changed. The new one can be accessed through getElementData ( theName ).

Source

The source of this event is the element whose elementdata changed.

Example

This example does...

--This line does...
blah()
--This line does this...
mooo