Skip to content

Commit

Permalink
Merge pull request #1533 from Kenshiin13/vehicle-seat
Browse files Browse the repository at this point in the history
feat(es_extended/client/modules/actions): track vehicle seat & add weapon playerdata
  • Loading branch information
Kenshiin13 authored Dec 8, 2024
2 parents 0e991ce + 3c6d887 commit 9083c38
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions [core]/es_extended/client/modules/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -140,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
Expand Down

0 comments on commit 9083c38

Please sign in to comment.