OnClientPreRender

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

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 milliseconds (varies from 0 to 100).

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 ( "onClientPreRender", getLocalPlayer(), updateCamera )

See Also

Other client events


Client event functions