From 01087c3c5a7a67e65f10d2c7adfbe3a93aa518c3 Mon Sep 17 00:00:00 2001 From: TheFantomas <117121911+TheFantomas@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:20:01 +0100 Subject: [PATCH] refactor(es_extended): DisableSeatShuff move --- [core]/es_extended/client/main.lua | 9 +++++++++ [core]/es_extended/client/modules/actions.lua | 6 ------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index 70869de4..0c851b5f 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -75,6 +75,15 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin) end end + if Config.DisableVehicleSeatShuff then + AddEventHandler('esx:enteredVehicle', function(vehicle, plate, seat) + if seat == 0 then + SetPedIntoVehicle(ESX.PlayerData.ped, vehicle, 0) + SetPedConfigFlag(ESX.PlayerData.ped, 184, true) + end + end) + end + if Config.DisableHealthRegeneration or Config.DisableWeaponWheel or Config.DisableAimAssist or Config.DisableVehicleRewards then CreateThread(function() while true do diff --git a/[core]/es_extended/client/modules/actions.lua b/[core]/es_extended/client/modules/actions.lua index 4123c485..95e14130 100644 --- a/[core]/es_extended/client/modules/actions.lua +++ b/[core]/es_extended/client/modules/actions.lua @@ -72,12 +72,6 @@ CreateThread(function() current.displayName, current.netId = GetData(current.vehicle) TriggerEvent('esx:enteredVehicle', current.vehicle, current.plate, current.seat, current.displayName, current.netId) TriggerServerEvent('esx:enteredVehicle', current.plate, current.seat, current.displayName, current.netId) - if Config.DisableVehicleSeatShuff then - if current.seat == 0 then - SetPedIntoVehicle(playerPed, current.vehicle, 0) - SetPedConfigFlag(playerPed, 184, true) - end - end end elseif isInVehicle then if not IsPedInAnyVehicle(playerPed, false) or IsPlayerDead(PlayerId()) then