Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(es_extended/client/modules/actions): track vehicle seat & add weapon playerdata #1533

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading