Skip to content

Commit

Permalink
feat(es_extended/client/actions): add debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Mycroft-Studios committed Dec 15, 2024
1 parent 5e5e4d3 commit 023dfa5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions [core]/es_extended/client/modules/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ function Actions:TrackPed()
ESX.SetPlayerData("ped", newPed)

TriggerEvent("esx:playerPedChanged", newPed)

if Config.EnableDebug then
print("[DEBUG] Player ped changed:", newPed)
end
end
end

Expand All @@ -58,6 +62,10 @@ function Actions:TrackPauseMenu()
if isActive ~= self.inPauseMenu then
self.inPauseMenu = isActive
TriggerEvent("esx:pauseMenuActive", isActive)

if Config.EnableDebug then
print("[DEBUG] Pause menu active:", isActive)
end
end
end

Expand All @@ -71,6 +79,10 @@ function Actions:EnterVehicle()
TriggerServerEvent("esx:enteringVehicle", plate, self.seat, netId)

self:SetVehicleStatus()

if Config.EnableDebug then
print("[DEBUG] Entering vehicle:", self.vehicle, plate, self.seat, netId)
end
end

function Actions:ResetVehicleData()
Expand All @@ -87,6 +99,10 @@ function Actions:EnterAborted()

TriggerEvent("esx:enteringVehicleAborted")
TriggerServerEvent("esx:enteringVehicleAborted")

if Config.EnableDebug then
print("[DEBUG] Entering vehicle aborted")
end
end

function Actions:WarpEnter()
Expand All @@ -100,6 +116,10 @@ function Actions:WarpEnter()
self:SetVehicleStatus()
TriggerEvent("esx:enteredVehicle", self.vehicle, plate, self.seat, displayName, netId)
TriggerServerEvent("esx:enteredVehicle", plate, self.seat, displayName, netId)

if Config.EnableDebug then
print("[DEBUG] Entered vehicle:", self.vehicle, plate, self.seat, displayName, netId)
end
end

function Actions:ExitVehicle()
Expand All @@ -111,6 +131,10 @@ function Actions:ExitVehicle()
TriggerEvent("esx:exitedVehicle", self.vehicle, plate, self.seat, displayName, netId)
TriggerServerEvent("esx:exitedVehicle", plate, self.seat, displayName, netId)

if Config.EnableDebug then
print("[DEBUG] Exited vehicle:", self.vehicle, plate, self.seat, displayName, netId)
end

self:ResetVehicleData()
end
end
Expand Down Expand Up @@ -144,6 +168,10 @@ function Actions:TrackSeat()
self.seat = newSeat
ESX.SetPlayerData("seat", self.seat)
TriggerEvent("esx:vehicleSeatChanged", self.seat)

if Config.EnableDebug then
print("[DEBUG] Vehicle seat changed:", self.seat)
end
end
end

Expand All @@ -156,6 +184,10 @@ function Actions:TrackWeapon()
self.currentWeapon = newWeapon
ESX.SetPlayerData("weapon", self.currentWeapon)
TriggerEvent("esx:weaponChanged", self.currentWeapon)

if Config.EnableDebug then
print("[DEBUG] Weapon changed:", self.currentWeapon)
end
end
end

Expand Down

0 comments on commit 023dfa5

Please sign in to comment.