OnPlayerContact

From Multi Theft Auto: Wiki
Revision as of 14:03, 1 December 2007 by Talidan (talk | contribs)
Jump to navigation Jump to search

This event is triggered when a player stands on an element.

Parameters

element previous, element current
  • previous: the element player was standing on before.
  • current: the new element that the player is standing on.

Source

The source of this event is the player who hit an element.

Example

This example outputs the element type of an element you have hit

function outputElementType ( prev, current )
	if ( current ) then
		outputChatBox ( "You have hit an "..getElementType ( current ) )
	end
end
addEventHandler ( "onPlayerContact", getRootElement(), outputElementType )

See Also