OnClientPreRender: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with '__NOTOC__ {{Client event}} This event is triggered every time before GTA renders a new frame. ==Parameters== ''None'' ==Source== The source of th…')
 
mNo edit summary
Line 4: Line 4:


==Parameters==
==Parameters==
''None''
<syntaxhighlight lang="lua">
float timeSlice
</syntaxhighlight>
*'''timeSlice:''' The interval between this frame and the previous one in seconds (varies from 0.0 to 0.1).


==Source==
==Source==

Revision as of 16:47, 5 August 2009

This event is triggered every time before GTA renders a new frame.

Parameters

float timeSlice
  • timeSlice: The interval between this frame and the previous one in seconds (varies from 0.0 to 0.1).

Source

The source of this event is the client's root element.

Example

This example makes the camera follow the player in a GTA2-like way.

function updateCamera ()
	local x, y, z = getElementPosition ( getLocalPlayer () )
	setCameraMatrix ( x, y, z + 50, x, y, z )
end
addEventHandler ( "onClientWorld", getLocalPlayer(), updateCamera )

See Also

Other client events


Client event functions

Shared