From db685e612bb4be2911ec7dbc8c68579a6be015d0 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Sun, 8 Dec 2024 23:30:00 +0100 Subject: [PATCH 1/2] feat(es_extended/client/modules/actions): track vehicle seat --- [core]/es_extended/client/modules/actions.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/[core]/es_extended/client/modules/actions.lua b/[core]/es_extended/client/modules/actions.lua index 16c75c80e..1b2206bb4 100644 --- a/[core]/es_extended/client/modules/actions.lua +++ b/[core]/es_extended/client/modules/actions.lua @@ -130,6 +130,20 @@ function Actions:TrackVehicle() end elseif self.inVehicle then self:ExitVehicle() + self:TrackSeat() + end +end + +function Actions:TrackSeat() + if not self.inVehicle then + return + end + + local newSeat = self:GetSeatPedIsIn() + if newSeat ~= self.seat then + self.seat = newSeat + ESX.SetPlayerData("seat", self.seat) + TriggerEvent("esx:vehicleSeatChanged", self.seat) end end From 3c6d88768014f462b994333419856b01c2296505 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Sun, 8 Dec 2024 23:38:13 +0100 Subject: [PATCH 2/2] feat(es_extended/client/modules/actions): add current weapon to playerdata --- [core]/es_extended/client/modules/actions.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/[core]/es_extended/client/modules/actions.lua b/[core]/es_extended/client/modules/actions.lua index 1b2206bb4..89c6757c6 100644 --- a/[core]/es_extended/client/modules/actions.lua +++ b/[core]/es_extended/client/modules/actions.lua @@ -154,6 +154,7 @@ function Actions:TrackWeapon() if newWeapon ~= self.currentWeapon then self.currentWeapon = newWeapon + ESX.SetPlayerData("weapon", self.currentWeapon) TriggerEvent("esx:weaponChanged", self.currentWeapon) end end