mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 18:58:54 +00:00
Merge pull request #1533 from Kenshiin13/vehicle-seat
feat(es_extended/client/modules/actions): track vehicle seat & add weapon playerdata
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user