mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
tweak(es_extended): move PvP and wanted level to adjustments
This commit is contained in:
@@ -4,13 +4,6 @@ ESX.SecureNetEvent("esx:requestModel", function(model)
|
||||
ESX.Streaming.RequestModel(model)
|
||||
end)
|
||||
|
||||
local function EnablePvP()
|
||||
if Config.EnablePVP then
|
||||
SetCanAttackFriendly(ESX.PlayerData.ped, true, false)
|
||||
NetworkSetFriendlyFireOption(true)
|
||||
end
|
||||
end
|
||||
|
||||
local function ApplyMetadata(metadata)
|
||||
if metadata.health then
|
||||
SetEntityHealth(ESX.PlayerData.ped, metadata.health)
|
||||
@@ -21,87 +14,6 @@ local function ApplyMetadata(metadata)
|
||||
end
|
||||
end
|
||||
|
||||
local function DisableNPCs()
|
||||
-- Disable Dispatch services
|
||||
if Config.DisableDispatchServices then
|
||||
for i = 1, 15 do
|
||||
EnableDispatchService(i, false)
|
||||
end
|
||||
SetAudioFlag('PoliceScannerDisabled', true)
|
||||
end
|
||||
|
||||
if Config.DisableScenarios then
|
||||
local scenarios = {
|
||||
"WORLD_VEHICLE_ATTRACTOR",
|
||||
"WORLD_VEHICLE_AMBULANCE",
|
||||
"WORLD_VEHICLE_BICYCLE_BMX",
|
||||
"WORLD_VEHICLE_BICYCLE_BMX_BALLAS",
|
||||
"WORLD_VEHICLE_BICYCLE_BMX_FAMILY",
|
||||
"WORLD_VEHICLE_BICYCLE_BMX_HARMONY",
|
||||
"WORLD_VEHICLE_BICYCLE_BMX_VAGOS",
|
||||
"WORLD_VEHICLE_BICYCLE_MOUNTAIN",
|
||||
"WORLD_VEHICLE_BICYCLE_ROAD",
|
||||
"WORLD_VEHICLE_BIKE_OFF_ROAD_RACE",
|
||||
"WORLD_VEHICLE_BIKER",
|
||||
"WORLD_VEHICLE_BOAT_IDLE",
|
||||
"WORLD_VEHICLE_BOAT_IDLE_ALAMO",
|
||||
"WORLD_VEHICLE_BOAT_IDLE_MARQUIS",
|
||||
"WORLD_VEHICLE_BOAT_IDLE_MARQUIS",
|
||||
"WORLD_VEHICLE_BROKEN_DOWN",
|
||||
"WORLD_VEHICLE_BUSINESSMEN",
|
||||
"WORLD_VEHICLE_HELI_LIFEGUARD",
|
||||
"WORLD_VEHICLE_CLUCKIN_BELL_TRAILER",
|
||||
"WORLD_VEHICLE_CONSTRUCTION_SOLO",
|
||||
"WORLD_VEHICLE_CONSTRUCTION_PASSENGERS",
|
||||
"WORLD_VEHICLE_DRIVE_PASSENGERS",
|
||||
"WORLD_VEHICLE_DRIVE_PASSENGERS_LIMITED",
|
||||
"WORLD_VEHICLE_DRIVE_SOLO",
|
||||
"WORLD_VEHICLE_FIRE_TRUCK",
|
||||
"WORLD_VEHICLE_EMPTY",
|
||||
"WORLD_VEHICLE_MARIACHI",
|
||||
"WORLD_VEHICLE_MECHANIC",
|
||||
"WORLD_VEHICLE_MILITARY_PLANES_BIG",
|
||||
"WORLD_VEHICLE_MILITARY_PLANES_SMALL",
|
||||
"WORLD_VEHICLE_PARK_PARALLEL",
|
||||
"WORLD_VEHICLE_PARK_PERPENDICULAR_NOSE_IN",
|
||||
"WORLD_VEHICLE_PASSENGER_EXIT",
|
||||
"WORLD_VEHICLE_POLICE_BIKE",
|
||||
"WORLD_VEHICLE_POLICE_CAR",
|
||||
"WORLD_VEHICLE_POLICE",
|
||||
"WORLD_VEHICLE_POLICE_NEXT_TO_CAR",
|
||||
"WORLD_VEHICLE_QUARRY",
|
||||
"WORLD_VEHICLE_SALTON",
|
||||
"WORLD_VEHICLE_SALTON_DIRT_BIKE",
|
||||
"WORLD_VEHICLE_SECURITY_CAR",
|
||||
"WORLD_VEHICLE_STREETRACE",
|
||||
"WORLD_VEHICLE_TOURBUS",
|
||||
"WORLD_VEHICLE_TOURIST",
|
||||
"WORLD_VEHICLE_TANDL",
|
||||
"WORLD_VEHICLE_TRACTOR",
|
||||
"WORLD_VEHICLE_TRACTOR_BEACH",
|
||||
"WORLD_VEHICLE_TRUCK_LOGS",
|
||||
"WORLD_VEHICLE_TRUCKS_TRAILERS",
|
||||
"WORLD_VEHICLE_DISTANT_EMPTY_GROUND",
|
||||
"WORLD_HUMAN_PAPARAZZI",
|
||||
}
|
||||
|
||||
for _, v in pairs(scenarios) do
|
||||
SetScenarioTypeEnabled(v, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function DisableAmmoOrVehicleRewards(playerId)
|
||||
|
||||
end
|
||||
|
||||
local function ApplyConfig()
|
||||
-- RemoveHudComponents
|
||||
|
||||
EnablePvP()
|
||||
DisableNPCs()
|
||||
end
|
||||
|
||||
ESX.SecureNetEvent("esx:playerLoaded", function(xPlayer, _, skin)
|
||||
ESX.PlayerData = xPlayer
|
||||
|
||||
@@ -142,7 +54,7 @@ ESX.SecureNetEvent("esx:playerLoaded", function(xPlayer, _, skin)
|
||||
end
|
||||
|
||||
Actions:Init()
|
||||
SetDefaultVehicleNumberPlateTextPattern(-1, Config.CustomAIPlates)
|
||||
|
||||
StartServerSyncLoops()
|
||||
end)
|
||||
|
||||
@@ -404,12 +316,6 @@ if not Config.CustomInventory and Config.EnableDefaultInventory then
|
||||
end)
|
||||
end
|
||||
|
||||
-- disable wanted level
|
||||
if not Config.EnableWantedLevel then
|
||||
ClearPlayerWantedLevel(ESX.playerId)
|
||||
SetMaxWantedLevel(0)
|
||||
end
|
||||
|
||||
if not Config.CustomInventory then
|
||||
CreateThread(function()
|
||||
while true do
|
||||
|
||||
@@ -208,6 +208,13 @@ function Adjustments:DiscordPresence()
|
||||
end
|
||||
end
|
||||
|
||||
function Adjustments:WantedLevel()
|
||||
if not Config.EnableWantedLevel then
|
||||
ClearPlayerWantedLevel(ESX.playerId)
|
||||
SetMaxWantedLevel(0)
|
||||
end
|
||||
end
|
||||
|
||||
function Adjustments:Load()
|
||||
self:RemoveHudComponents()
|
||||
self:DisableAimAssist()
|
||||
@@ -220,4 +227,5 @@ function Adjustments:Load()
|
||||
self:NPCScenarios()
|
||||
self:LicensePlates()
|
||||
self:DiscordPresence()
|
||||
self:WantedLevel()
|
||||
end
|
||||
|
||||
@@ -3,10 +3,11 @@ Config.DisableVehicleRewards = false -- Disables Player Receiving weapons from v
|
||||
Config.DisableNPCDrops = false -- stops NPCs from dropping weapons on death
|
||||
Config.DisableDispatchServices = true -- Disable Dispatch services
|
||||
Config.DisableScenarios = true -- Disable Scenarios
|
||||
Config.DisableWeaponWheel = false -- Disables default weapon wheel
|
||||
Config.DisableAimAssist = false -- disables AIM assist (mainly on controllers)
|
||||
Config.DisableVehicleSeatShuff = false -- Disables vehicle seat shuff
|
||||
Config.DisableDisplayAmmo = false -- Disable ammunition display
|
||||
Config.EnablePVP = true -- Allow Player to player combat
|
||||
Config.EnableWantedLevel = false -- Use Normal GTA wanted Level?
|
||||
|
||||
Config.RemoveHudComponents = {
|
||||
[1] = false, --WANTED_STARS,
|
||||
|
||||
@@ -40,8 +40,7 @@ Config.EnableSocietyPayouts = false -- pay from the society account that the pla
|
||||
Config.MaxWeight = 24 -- the max inventory weight without a backpack
|
||||
Config.PaycheckInterval = 7 * 60000 -- how often to receive paychecks in milliseconds
|
||||
Config.EnableDebug = false -- Use Debug options?
|
||||
Config.EnableWantedLevel = false -- Use Normal GTA wanted Level?
|
||||
Config.EnablePVP = true -- Allow Player to player combat
|
||||
|
||||
Config.DefaultJobDuty = true -- A players default duty status when changing jobs
|
||||
|
||||
Config.Multichar = GetResourceState("esx_multicharacter") ~= "missing"
|
||||
|
||||
Reference in New Issue
Block a user