mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:01:22 +00:00
refactor(es_extended): DisableSeatShuff move
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user