Improvement: Set the camera position offset from the entity

- Modifying the spawn location would previously require adjusting the camera parameters.

- This, along with the previous camera change, ensures the camera is always facing the ped
This commit is contained in:
Linden
2021-07-26 21:22:17 +10:00
parent 7bf9367135
commit b5b5f56a2b
3 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -29,11 +29,11 @@ if ESX.GetConfig().Multichar then
local playerPed = PlayerPedId()
SetEntityCoords(playerPed, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z, true, false, false, false)
SetEntityHeading(playerPed, Config.Spawn.w)
local offset = GetOffsetFromEntityInWorldCoords(playerPed, 0, 1.7, 0.4)
DoScreenFadeOut(0)
SetCamActive(cam, true)
RenderScriptCams(true, false, 1, true, true)
SetCamCoord(cam, Config.Spawn.x, Config.Spawn.y + 1.6, Config.Spawn.z + 1.3)
SetCamCoord(cam, offset.x, offset.y, offset.z)
PointCamAtCoord(cam, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z + 1.3)
ESX.UI.HUD.SetDisplay(0.0)