refactor(es_extended): DisableSeatShuff move

This commit is contained in:
TheFantomas
2023-03-20 16:20:01 +01:00
parent 0b2e7a35af
commit 01087c3c5a
2 changed files with 9 additions and 6 deletions
+9
View File
@@ -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
@@ -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