OnClientElementDataChange: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Client event}} | |||
__NOTOC__ | __NOTOC__ | ||
This event is | This event is triggered whenever an element's ''[[element data]]'' is changed. | ||
==Syntax== | ==Syntax== | ||
Line 10: | Line 9: | ||
==Example== | ==Example== | ||
This example | This example tells the client whenever a HOT AIR "class" element data is changed. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler ( "onClientElementDataChange", getRootElement(), | |||
function ( dataName ) | |||
if getElementType ( source ) == "player" and dataName == "class" then | |||
outputChatBox ( getPlayerName(source).." changed his class to "..getElementData ( source, "class" ) | |||
end | |||
end ) | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 13:06, 22 October 2007
This event is triggered whenever an element's element data is changed.
Syntax
void onClientElementDataChange ( string name )
Example
This example tells the client whenever a HOT AIR "class" element data is changed.
addEventHandler ( "onClientElementDataChange", getRootElement(), function ( dataName ) if getElementType ( source ) == "player" and dataName == "class" then outputChatBox ( getPlayerName(source).." changed his class to "..getElementData ( source, "class" ) end end )