OnClientElementDataChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
[[Category:Incomplete Event]]
{{Client event}}
 
__NOTOC__  
__NOTOC__  
This event is blahblah and is used for blahblah.
This event is triggered whenever an element's ''[[element data]]'' is changed.


==Syntax==  
==Syntax==  
Line 10: Line 9:


==Example==  
==Example==  
This example does...
This example tells the client whenever a HOT AIR "class" element data is changed.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
addEventHandler ( "onClientElementDataChange", getRootElement(),
blabhalbalhb --abababa
function ( dataName )
--This line does this...
if getElementType ( source ) == "player" and dataName == "class" then
mooo
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 )