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:21:57 +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)
+2 -1
View File
@@ -2,7 +2,8 @@ Config = {}
Config.Locale = 'en'
Config.Slots = 4
Config.Spawn = vector4(-113.7, 565.3, 195.2, 0)
Config.Spawn = vector4(-113.7, 565.3, 195.2, 0) -- Sets the location for character selection
-- To set the spawn location for new characters, modify the default value in the `users` SQL table
--------------------
-- Do not use unless you are prepared to adjust your resources to correctly reset data
+1 -1
View File
@@ -1,7 +1,7 @@
fx_version 'adamant'
game 'gta5'
description 'https://github.com/thelindat/esx_multicharacter'
version '1.2.1'
version '1.2.2'
dependencies {
'es_extended',