mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
Fix DisableVehicleRewards
This commit is contained in:
@@ -74,31 +74,7 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
|
||||
end
|
||||
end
|
||||
|
||||
-- DisableVehicleRewards
|
||||
if Config.DisableVehicleRewards then
|
||||
local inVehicle = false
|
||||
|
||||
local function DisableVehicleRewardsThread()
|
||||
CreateThread(function()
|
||||
while inVehicle do
|
||||
DisablePlayerVehicleRewards(playerId)
|
||||
Wait(0)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
AddEventHandler('esx:enteredVehicle', function(vehicle, plate, seat, displayName, netId)
|
||||
if GetVehicleClass(vehicle) == 18 then
|
||||
DisableVehicleRewardsThread()
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('esx:exitedVehicle', function(vehicle, plate, seat, displayName, netId)
|
||||
inVehicle = false
|
||||
end)
|
||||
end
|
||||
|
||||
if Config.DisableHealthRegeneration or Config.DisableWeaponWheel or Config.DisableAimAssist then
|
||||
if Config.DisableHealthRegeneration or Config.DisableWeaponWheel or Config.DisableAimAssist or Config.DisableVehicleRewards then
|
||||
CreateThread(function()
|
||||
while true do
|
||||
if Config.DisableHealthRegeneration then
|
||||
@@ -115,6 +91,10 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
|
||||
SetPlayerLockonRangeOverride(playerId, 2.0)
|
||||
end
|
||||
end
|
||||
|
||||
if Config.DisableVehicleRewards then
|
||||
DisablePlayerVehicleRewards(playerId)
|
||||
end
|
||||
|
||||
Wait(0)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user