SetPedCameraRotation

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

This function sets the camera rotation of a ped.

Syntax

bool setPedCameraRotation ( ped thePed, float cameraRotation )

Required Arguments

  • thePed: The ped whose camera rotation is to be changed
  • cameraRotation: The new direction that the ped will walk if you set their forwards control state

Returns

Returns true if the camera rotation was changed, false otherwise.

Example

--TODO

See Also




addEventHandler ( 'onClientResourceStart', resourceRoot, function () ped = createPed ( 0, 0,0,3) -- create the ped at the coordinate ( x = 0, y = 0, z = 3 )

addEventHandler ('onClientPedDamage', ped, function () -- add Event when the ped got damaged local rot = getPedCameraRotation ( ped ) -- get the current camera rotation setPedCameraRotation ( ped, rot + 90 ) -- add to the current camerarotation 90 deg. end)

end)