From 01a59fa73903f2d8602ef085bfa68feb1ad6a9c4 Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 10:21:57 +0100 Subject: [PATCH 01/12] creating placeholder for modules, and creating config 'enums' --- config.lua | 202 ++++++++++++++++++++------------- modules/modulesPlaceholder.lua | 1 + 2 files changed, 121 insertions(+), 82 deletions(-) create mode 100644 modules/modulesPlaceholder.lua diff --git a/config.lua b/config.lua index e20edbd..918398d 100644 --- a/config.lua +++ b/config.lua @@ -1,3 +1,42 @@ +VehicleClasses = { + Compacts = 0, + Sedans = 1, + SUVs = 2, + Coupes = 3, + Muscle = 4, + Sports_Classics = 5, + Sports = 6, + Super = 7, + Motorcycles = 8, + Off_road = 9, + Industrial = 10, + Utility = 11, + Vans = 12, + Cycles = 13, + Boats = 14, + Helicopters = 15, + Planes = 16, + Service = 17, + Emergency = 18, + Military = 19, + Commercial = 20, + Trains = 21, + Open_Wheel = 22, +} + +WeaponTypeGroups = { + Melee = 2685387236, + Handgun = 416676503, + SMG = -957766203, + Shotgun = 860033945, + Rifle = 970310034, + LMG = 1159398588, + Sniper = 3082541095, + Heavy = 2725924767, + Throwable = 1548507267, + Misc = 4257178988, +} + Config = { debug = true, -- Set to true for development purposes only. Used for zones, and essential prints. Will be removed upon release @@ -9,54 +48,54 @@ Config = { -- Lockpick Settings removeNormalLockpickChance = { -- Chance to remove lockpick on fail by vehicle class - [0] = 0.5, -- Compacts - [1] = 0.5, -- Sedans - [2] = 0.5, -- SUVs - [3] = 0.5, -- Coupes - [4] = 0.5, -- Muscle - [5] = 0.5, -- Sports Classics - [6] = 0.5, -- Sports - [7] = 0.5, -- Super - [8] = 0.5, -- Motorcycles - [9] = 0.5, -- Off-road - [10] = 0.5, -- Industrial - [11] = 0.5, -- Utility - [12] = 0.5, -- Vans - [13] = 0.5, -- Cycles - [14] = 0.5, -- Boats - [15] = 0.5, -- Helicopters - [16] = 0.5, -- Planes - [17] = 0.5, -- Service - [18] = 0.5, -- Emergency - [19] = 0.5, -- Military - [20] = 0.5, -- Commercial - [21] = 0.5, -- Trains - [22] = 0.5, -- Open Wheel + [VehicleClasses.Compacts] = 0.5, + [VehicleClasses.Sedans] = 0.5, + [VehicleClasses.SUVs] = 0.5, + [VehicleClasses.Coupes] = 0.5, + [VehicleClasses.Muscle] = 0.5, + [VehicleClasses.Sports_Classics] = 0.5, + [VehicleClasses.Sports] = 0.5, + [VehicleClasses.Super] = 0.5, + [VehicleClasses.Motorcycles] = 0.5, + [VehicleClasses.Off_road] = 0.5, + [VehicleClasses.Industrial] = 0.5, + [VehicleClasses.Utility] = 0.5, + [VehicleClasses.Vans] = 0.5, + [VehicleClasses.Cycles] = 0.5, + [VehicleClasses.Boats] = 0.5, + [VehicleClasses.Helicopters] = 0.5, + [VehicleClasses.Planes] = 0.5, + [VehicleClasses.Service] = 0.5, + [VehicleClasses.Emergency] = 0.5, + [VehicleClasses.Military] = 0.5, + [VehicleClasses.Commercial] = 0.5, + [VehicleClasses.Trains] = 0.5, + [VehicleClasses.Open_Wheel] = 0.5 }, removeAdvancedLockpickChance = { -- Chance to remove advanced lockpick on fail by vehicle class - [0] = 0.5, -- Compacts - [1] = 0.5, -- Sedans - [2] = 0.5, -- SUVs - [3] = 0.5, -- Coupes - [4] = 0.5, -- Muscle - [5] = 0.5, -- Sports Classics - [6] = 0.5, -- Sports - [7] = 0.5, -- Super - [8] = 0.5, -- Motorcycles - [9] = 0.5, -- Off-road - [10] = 0.5, -- Industrial - [11] = 0.5, -- Utility - [12] = 0.5, -- Vans - [13] = 0.5, -- Cycles - [14] = 0.5, -- Boats - [15] = 0.5, -- Helicopters - [16] = 0.5, -- Planes - [17] = 0.5, -- Service - [18] = 0.5, -- Emergency - [19] = 0.5, -- Military - [20] = 0.5, -- Commercial - [21] = 0.5, -- Trains - [22] = 0.5, -- Open Wheel + [VehicleClasses.Compacts] = 0.5, + [VehicleClasses.Sedans] = 0.5, + [VehicleClasses.SUVs] = 0.5, + [VehicleClasses.Coupes] = 0.5, + [VehicleClasses.Muscle] = 0.5, + [VehicleClasses.Sports_Classics] = 0.5, + [VehicleClasses.Sports] = 0.5, + [VehicleClasses.Super] = 0.5, + [VehicleClasses.Motorcycles] = 0.5, + [VehicleClasses.Off_road] = 0.5, + [VehicleClasses.Industrial] = 0.5, + [VehicleClasses.Utility] = 0.5, + [VehicleClasses.Vans] = 0.5, + [VehicleClasses.Cycles] = 0.5, + [VehicleClasses.Boats] = 0.5, + [VehicleClasses.Helicopters] = 0.5, + [VehicleClasses.Planes] = 0.5, + [VehicleClasses.Service] = 0.5, + [VehicleClasses.Emergency] = 0.5, + [VehicleClasses.Military] = 0.5, + [VehicleClasses.Commercial] = 0.5, + [VehicleClasses.Trains] = 0.5, + [VehicleClasses.Open_Wheel] = 0.5 }, -- Carjack Settings @@ -64,45 +103,44 @@ Config = { carjackingTimeInMs = 7500, -- Time it takes to successfully carjack in miliseconds delayBetweenCarjackingsInMs = 10000, -- Time before you can attempt another carjack in miliseconds carjackChance = { -- Probability of successful carjacking based on weapon used - [2685387236] = 0.0, -- melee - [416676503] = 0.5, -- handguns - [-957766203] = 0.75, -- SMG - [860033945] = 0.90, -- shotgun - [970310034] = 0.90, -- assault - [1159398588] = 0.99, -- LMG - [3082541095] = 0.99, -- sniper - [2725924767] = 0.99, -- heavy - [1548507267] = 0.0, -- throwable - [4257178988] = 0.0, -- misc - -- Add more weapon IDs and probabilities as needed + [WeaponTypeGroups.Melee] = 0.0, -- melee + [WeaponTypeGroups.Handgun] = 0.5, -- handguns + [WeaponTypeGroups.SMG] = 0.75, -- SMG + [WeaponTypeGroups.Shotgun] = 0.90, -- shotgun + [WeaponTypeGroups.Rifle] = 0.90, -- assault + [WeaponTypeGroups.LMG] = 0.99, -- LMG + [WeaponTypeGroups.Sniper] = 0.99, -- sniper + [WeaponTypeGroups.Heavy] = 0.99, -- heavy + [WeaponTypeGroups.Throwable] = 0.0, -- throwable + [WeaponTypeGroups.Misc] = 0.0, -- misc }, -- Hotwire Settings - hotwireChance = { - [0] = 0.5, -- Compacts - [1] = 0.5, -- Sedans - [2] = 0.5, -- SUVs - [3] = 0.5, -- Coupes - [4] = 0.5, -- Muscle - [5] = 0.5, -- Sports Classics - [6] = 0.5, -- Sports - [7] = 0.5, -- Super - [8] = 0.5, -- Motorcycles - [9] = 0.5, -- Off-road - [10] = 0.5, -- Industrial - [11] = 0.5, -- Utility - [12] = 0.5, -- Vans - [13] = 0.5, -- Cycles - [14] = 0.5, -- Boats - [15] = 0.5, -- Helicopters - [16] = 0.5, -- Planes - [17] = 0.5, -- Service - [18] = 0.5, -- Emergency - [19] = 0.5, -- Military - [20] = 0.5, -- Commercial - [21] = 0.5, -- Trains - [22] = 0.5, -- Open Wheel - }, -- Chance for a successful hotwire by vehicle Class + hotwireChance = { -- Chance for a successful hotwire by vehicle Class + [VehicleClasses.Compacts] = 0.5, + [VehicleClasses.Sedans] = 0.5, + [VehicleClasses.SUVs] = 0.5, + [VehicleClasses.Coupes] = 0.5, + [VehicleClasses.Muscle] = 0.5, + [VehicleClasses.Sports_Classics] = 0.5, + [VehicleClasses.Sports] = 0.5, + [VehicleClasses.Super] = 0.5, + [VehicleClasses.Motorcycles] = 0.5, + [VehicleClasses.Off_road] = 0.5, + [VehicleClasses.Industrial] = 0.5, + [VehicleClasses.Utility] = 0.5, + [VehicleClasses.Vans] = 0.5, + [VehicleClasses.Cycles] = 0.5, + [VehicleClasses.Boats] = 0.5, + [VehicleClasses.Helicopters] = 0.5, + [VehicleClasses.Planes] = 0.5, + [VehicleClasses.Service] = 0.5, + [VehicleClasses.Emergency] = 0.5, + [VehicleClasses.Military] = 0.5, + [VehicleClasses.Commercial] = 0.5, + [VehicleClasses.Trains] = 0.5, + [VehicleClasses.Open_Wheel] = 0.5 + }, timeBetweenHotwires = 5000, -- Time in milliseconds between hotwire attempts minHotwireTime = 20000, -- Minimum hotwire time in milliseconds maxHotwireTime = 40000, -- Maximum hotwire time in milliseconds diff --git a/modules/modulesPlaceholder.lua b/modules/modulesPlaceholder.lua new file mode 100644 index 0000000..f326326 --- /dev/null +++ b/modules/modulesPlaceholder.lua @@ -0,0 +1 @@ +--- This is only a placeholder. Folder contents not yet implemented \ No newline at end of file From afa2696108ab28a3fd892844d134378075e3527e Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 10:23:13 +0100 Subject: [PATCH 02/12] creating shared folder --- shared/functions.lua | 1 + 1 file changed, 1 insertion(+) create mode 100644 shared/functions.lua diff --git a/shared/functions.lua b/shared/functions.lua new file mode 100644 index 0000000..14c37fb --- /dev/null +++ b/shared/functions.lua @@ -0,0 +1 @@ +--- Placeholder. Not Yet Implemented \ No newline at end of file From 780a72b88d314f6778e704b593d664c6755d1ec1 Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 10:26:15 +0100 Subject: [PATCH 03/12] removed old comments --- config.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config.lua b/config.lua index 918398d..e5f385f 100644 --- a/config.lua +++ b/config.lua @@ -103,16 +103,16 @@ Config = { carjackingTimeInMs = 7500, -- Time it takes to successfully carjack in miliseconds delayBetweenCarjackingsInMs = 10000, -- Time before you can attempt another carjack in miliseconds carjackChance = { -- Probability of successful carjacking based on weapon used - [WeaponTypeGroups.Melee] = 0.0, -- melee - [WeaponTypeGroups.Handgun] = 0.5, -- handguns - [WeaponTypeGroups.SMG] = 0.75, -- SMG - [WeaponTypeGroups.Shotgun] = 0.90, -- shotgun - [WeaponTypeGroups.Rifle] = 0.90, -- assault - [WeaponTypeGroups.LMG] = 0.99, -- LMG - [WeaponTypeGroups.Sniper] = 0.99, -- sniper - [WeaponTypeGroups.Heavy] = 0.99, -- heavy - [WeaponTypeGroups.Throwable] = 0.0, -- throwable - [WeaponTypeGroups.Misc] = 0.0, -- misc + [WeaponTypeGroups.Melee] = 0.0, + [WeaponTypeGroups.Handgun] = 0.5, + [WeaponTypeGroups.SMG] = 0.75, + [WeaponTypeGroups.Shotgun] = 0.90, + [WeaponTypeGroups.Rifle] = 0.90, + [WeaponTypeGroups.LMG] = 0.99, + [WeaponTypeGroups.Sniper] = 0.99, + [WeaponTypeGroups.Heavy] = 0.99, + [WeaponTypeGroups.Throwable] = 0.0, + [WeaponTypeGroups.Misc] = 0.0, }, -- Hotwire Settings From dfd7971c100fe9f4c71d86e1907fe7bf2dc2fb6d Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 10:30:12 +0100 Subject: [PATCH 04/12] adding global functions.lua to fxmanifest --- fxmanifest.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/fxmanifest.lua b/fxmanifest.lua index 8ad7f55..7761937 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -12,6 +12,7 @@ shared_scripts { 'locales/en.lua', 'locales/*.lua', 'config.lua', + 'shared/functions.lua' } client_scripts { From 3ff0b2c88a64a9a007ce49199402e4b5419c02db Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 10:45:02 +0100 Subject: [PATCH 05/12] making 'enum' keys upper case --- config.lua | 216 ++++++++++++++++++++++++++--------------------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/config.lua b/config.lua index e5f385f..aa4df7e 100644 --- a/config.lua +++ b/config.lua @@ -1,40 +1,40 @@ VehicleClasses = { - Compacts = 0, - Sedans = 1, - SUVs = 2, - Coupes = 3, - Muscle = 4, - Sports_Classics = 5, - Sports = 6, - Super = 7, - Motorcycles = 8, - Off_road = 9, - Industrial = 10, - Utility = 11, - Vans = 12, - Cycles = 13, - Boats = 14, - Helicopters = 15, - Planes = 16, - Service = 17, - Emergency = 18, - Military = 19, - Commercial = 20, - Trains = 21, - Open_Wheel = 22, + COMPACTS = 0, + SEDANS = 1, + SUVS = 2, + COUPES = 3, + MUSCLE = 4, + SPORTS_CLASSICS = 5, + SPORTS = 6, + SUPER = 7, + MOTORCYCLES = 8, + OFF_ROAD = 9, + INDUSTRIAL = 10, + UTILITY = 11, + VANS = 12, + CYCLES = 13, + BOATS = 14, + HELICOPTERS = 15, + PLANES = 16, + SERVICE = 17, + EMERGENCY = 18, + MILITARY = 19, + COMMERCIAL = 20, + TRAINS = 21, + OPEN_WHEEL = 22, } WeaponTypeGroups = { - Melee = 2685387236, - Handgun = 416676503, + MELEE = 2685387236, + HANDGUN = 416676503, SMG = -957766203, - Shotgun = 860033945, - Rifle = 970310034, + SHOTGUN = 860033945, + RIFLE = 970310034, LMG = 1159398588, - Sniper = 3082541095, - Heavy = 2725924767, - Throwable = 1548507267, - Misc = 4257178988, + SNIPER = 3082541095, + HEAVY = 2725924767, + THROWABLE = 1548507267, + MISC = 4257178988, } Config = { @@ -48,54 +48,54 @@ Config = { -- Lockpick Settings removeNormalLockpickChance = { -- Chance to remove lockpick on fail by vehicle class - [VehicleClasses.Compacts] = 0.5, - [VehicleClasses.Sedans] = 0.5, - [VehicleClasses.SUVs] = 0.5, - [VehicleClasses.Coupes] = 0.5, - [VehicleClasses.Muscle] = 0.5, - [VehicleClasses.Sports_Classics] = 0.5, - [VehicleClasses.Sports] = 0.5, - [VehicleClasses.Super] = 0.5, - [VehicleClasses.Motorcycles] = 0.5, - [VehicleClasses.Off_road] = 0.5, - [VehicleClasses.Industrial] = 0.5, - [VehicleClasses.Utility] = 0.5, - [VehicleClasses.Vans] = 0.5, - [VehicleClasses.Cycles] = 0.5, - [VehicleClasses.Boats] = 0.5, - [VehicleClasses.Helicopters] = 0.5, - [VehicleClasses.Planes] = 0.5, - [VehicleClasses.Service] = 0.5, - [VehicleClasses.Emergency] = 0.5, - [VehicleClasses.Military] = 0.5, - [VehicleClasses.Commercial] = 0.5, - [VehicleClasses.Trains] = 0.5, - [VehicleClasses.Open_Wheel] = 0.5 + [VehicleClasses.COMPACTS] = 0.5, + [VehicleClasses.SEDANS] = 0.5, + [VehicleClasses.SUVS] = 0.5, + [VehicleClasses.COUPES] = 0.5, + [VehicleClasses.MUSCLE] = 0.5, + [VehicleClasses.SPORTS_CLASSICS] = 0.5, + [VehicleClasses.SPORTS] = 0.5, + [VehicleClasses.SUPER] = 0.5, + [VehicleClasses.MOTORCYCLES] = 0.5, + [VehicleClasses.OFF_ROAD] = 0.5, + [VehicleClasses.INDUSTRIAL] = 0.5, + [VehicleClasses.UTILITY] = 0.5, + [VehicleClasses.VANS] = 0.5, + [VehicleClasses.CYCLES] = 0.5, + [VehicleClasses.BOATS] = 0.5, + [VehicleClasses.HELICOPTERS] = 0.5, + [VehicleClasses.PLANES] = 0.5, + [VehicleClasses.SERVICE] = 0.5, + [VehicleClasses.EMERGENCY] = 0.5, + [VehicleClasses.MILITARY] = 0.5, + [VehicleClasses.COMMERCIAL] = 0.5, + [VehicleClasses.TRAINS] = 0.5, + [VehicleClasses.OPEN_WHEEL] = 0.5 }, removeAdvancedLockpickChance = { -- Chance to remove advanced lockpick on fail by vehicle class - [VehicleClasses.Compacts] = 0.5, - [VehicleClasses.Sedans] = 0.5, - [VehicleClasses.SUVs] = 0.5, - [VehicleClasses.Coupes] = 0.5, - [VehicleClasses.Muscle] = 0.5, - [VehicleClasses.Sports_Classics] = 0.5, - [VehicleClasses.Sports] = 0.5, - [VehicleClasses.Super] = 0.5, - [VehicleClasses.Motorcycles] = 0.5, - [VehicleClasses.Off_road] = 0.5, - [VehicleClasses.Industrial] = 0.5, - [VehicleClasses.Utility] = 0.5, - [VehicleClasses.Vans] = 0.5, - [VehicleClasses.Cycles] = 0.5, - [VehicleClasses.Boats] = 0.5, - [VehicleClasses.Helicopters] = 0.5, - [VehicleClasses.Planes] = 0.5, - [VehicleClasses.Service] = 0.5, - [VehicleClasses.Emergency] = 0.5, - [VehicleClasses.Military] = 0.5, - [VehicleClasses.Commercial] = 0.5, - [VehicleClasses.Trains] = 0.5, - [VehicleClasses.Open_Wheel] = 0.5 + [VehicleClasses.COMPACTS] = 0.5, + [VehicleClasses.SEDANS] = 0.5, + [VehicleClasses.SUVS] = 0.5, + [VehicleClasses.COUPES] = 0.5, + [VehicleClasses.MUSCLE] = 0.5, + [VehicleClasses.SPORTS_CLASSICS] = 0.5, + [VehicleClasses.SPORTS] = 0.5, + [VehicleClasses.SUPER] = 0.5, + [VehicleClasses.MOTORCYCLES] = 0.5, + [VehicleClasses.OFF_ROAD] = 0.5, + [VehicleClasses.INDUSTRIAL] = 0.5, + [VehicleClasses.UTILITY] = 0.5, + [VehicleClasses.VANS] = 0.5, + [VehicleClasses.CYCLES] = 0.5, + [VehicleClasses.BOATS] = 0.5, + [VehicleClasses.HELICOPTERS] = 0.5, + [VehicleClasses.PLANES] = 0.5, + [VehicleClasses.SERVICE] = 0.5, + [VehicleClasses.EMERGENCY] = 0.5, + [VehicleClasses.MILITARY] = 0.5, + [VehicleClasses.COMMERCIAL] = 0.5, + [VehicleClasses.TRAINS] = 0.5, + [VehicleClasses.OPEN_WHEEL] = 0.5 }, -- Carjack Settings @@ -103,43 +103,43 @@ Config = { carjackingTimeInMs = 7500, -- Time it takes to successfully carjack in miliseconds delayBetweenCarjackingsInMs = 10000, -- Time before you can attempt another carjack in miliseconds carjackChance = { -- Probability of successful carjacking based on weapon used - [WeaponTypeGroups.Melee] = 0.0, - [WeaponTypeGroups.Handgun] = 0.5, + [WeaponTypeGroups.MELEE] = 0.0, + [WeaponTypeGroups.HANDGUN] = 0.5, [WeaponTypeGroups.SMG] = 0.75, - [WeaponTypeGroups.Shotgun] = 0.90, - [WeaponTypeGroups.Rifle] = 0.90, + [WeaponTypeGroups.SHOTGUN] = 0.90, + [WeaponTypeGroups.RIFLE] = 0.90, [WeaponTypeGroups.LMG] = 0.99, - [WeaponTypeGroups.Sniper] = 0.99, - [WeaponTypeGroups.Heavy] = 0.99, - [WeaponTypeGroups.Throwable] = 0.0, - [WeaponTypeGroups.Misc] = 0.0, + [WeaponTypeGroups.SNIPER] = 0.99, + [WeaponTypeGroups.HEAVY] = 0.99, + [WeaponTypeGroups.THROWABLE] = 0.0, + [WeaponTypeGroups.MISC] = 0.0, }, -- Hotwire Settings hotwireChance = { -- Chance for a successful hotwire by vehicle Class - [VehicleClasses.Compacts] = 0.5, - [VehicleClasses.Sedans] = 0.5, - [VehicleClasses.SUVs] = 0.5, - [VehicleClasses.Coupes] = 0.5, - [VehicleClasses.Muscle] = 0.5, - [VehicleClasses.Sports_Classics] = 0.5, - [VehicleClasses.Sports] = 0.5, - [VehicleClasses.Super] = 0.5, - [VehicleClasses.Motorcycles] = 0.5, - [VehicleClasses.Off_road] = 0.5, - [VehicleClasses.Industrial] = 0.5, - [VehicleClasses.Utility] = 0.5, - [VehicleClasses.Vans] = 0.5, - [VehicleClasses.Cycles] = 0.5, - [VehicleClasses.Boats] = 0.5, - [VehicleClasses.Helicopters] = 0.5, - [VehicleClasses.Planes] = 0.5, - [VehicleClasses.Service] = 0.5, - [VehicleClasses.Emergency] = 0.5, - [VehicleClasses.Military] = 0.5, - [VehicleClasses.Commercial] = 0.5, - [VehicleClasses.Trains] = 0.5, - [VehicleClasses.Open_Wheel] = 0.5 + [VehicleClasses.COMPACTS] = 0.5, + [VehicleClasses.SEDANS] = 0.5, + [VehicleClasses.SUVS] = 0.5, + [VehicleClasses.COUPES] = 0.5, + [VehicleClasses.MUSCLE] = 0.5, + [VehicleClasses.SPORTS_CLASSICS] = 0.5, + [VehicleClasses.SPORTS] = 0.5, + [VehicleClasses.SUPER] = 0.5, + [VehicleClasses.MOTORCYCLES] = 0.5, + [VehicleClasses.OFF_ROAD] = 0.5, + [VehicleClasses.INDUSTRIAL] = 0.5, + [VehicleClasses.UTILITY] = 0.5, + [VehicleClasses.VANS] = 0.5, + [VehicleClasses.CYCLES] = 0.5, + [VehicleClasses.BOATS] = 0.5, + [VehicleClasses.HELICOPTERS] = 0.5, + [VehicleClasses.PLANES] = 0.5, + [VehicleClasses.SERVICE] = 0.5, + [VehicleClasses.EMERGENCY] = 0.5, + [VehicleClasses.MILITARY] = 0.5, + [VehicleClasses.COMMERCIAL] = 0.5, + [VehicleClasses.TRAINS] = 0.5, + [VehicleClasses.OPEN_WHEEL] = 0.5 }, timeBetweenHotwires = 5000, -- Time in milliseconds between hotwire attempts minHotwireTime = 20000, -- Minimum hotwire time in milliseconds From fda7a6fa98017bf19593d5e2e53354734080f7e6 Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 10:58:32 +0100 Subject: [PATCH 06/12] deleting shared and modules based on suggestion by Manason --- modules/modulesPlaceholder.lua | 1 - shared/functions.lua | 1 - 2 files changed, 2 deletions(-) delete mode 100644 modules/modulesPlaceholder.lua delete mode 100644 shared/functions.lua diff --git a/modules/modulesPlaceholder.lua b/modules/modulesPlaceholder.lua deleted file mode 100644 index f326326..0000000 --- a/modules/modulesPlaceholder.lua +++ /dev/null @@ -1 +0,0 @@ ---- This is only a placeholder. Folder contents not yet implemented \ No newline at end of file diff --git a/shared/functions.lua b/shared/functions.lua deleted file mode 100644 index 14c37fb..0000000 --- a/shared/functions.lua +++ /dev/null @@ -1 +0,0 @@ ---- Placeholder. Not Yet Implemented \ No newline at end of file From c6cdc74446b4d7af03231faab4e2e89de10ff51b Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 12:14:37 +0100 Subject: [PATCH 07/12] config folder and placeholders --- config/client.lua | 0 config/server.lua | 0 config/shared.lua | 4 ++++ 3 files changed, 4 insertions(+) create mode 100644 config/client.lua create mode 100644 config/server.lua create mode 100644 config/shared.lua diff --git a/config/client.lua b/config/client.lua new file mode 100644 index 0000000..e69de29 diff --git a/config/server.lua b/config/server.lua new file mode 100644 index 0000000..e69de29 diff --git a/config/shared.lua b/config/shared.lua new file mode 100644 index 0000000..d85a234 --- /dev/null +++ b/config/shared.lua @@ -0,0 +1,4 @@ +--- placeholder. Not yet implemented +return { + +} \ No newline at end of file From 595920c614e938583d28fd1991acdc7a268371a4 Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 12:19:57 +0100 Subject: [PATCH 08/12] moving config.lua content to config/client.lua / also some cleanup --- config/client.lua | 215 ++++++++++++++++++++++++++++++++++++++++++++++ config/server.lua | 2 + config/shared.lua | 4 +- 3 files changed, 218 insertions(+), 3 deletions(-) diff --git a/config/client.lua b/config/client.lua index e69de29..be9c188 100644 --- a/config/client.lua +++ b/config/client.lua @@ -0,0 +1,215 @@ +--- placeholder. Not yet implemented + +VehicleClasses = { + COMPACTS = 0, + SEDANS = 1, + SUVS = 2, + COUPES = 3, + MUSCLE = 4, + SPORTS_CLASSICS = 5, + SPORTS = 6, + SUPER = 7, + MOTORCYCLES = 8, + OFF_ROAD = 9, + INDUSTRIAL = 10, + UTILITY = 11, + VANS = 12, + CYCLES = 13, + BOATS = 14, + HELICOPTERS = 15, + PLANES = 16, + SERVICE = 17, + EMERGENCY = 18, + MILITARY = 19, + COMMERCIAL = 20, + TRAINS = 21, + OPEN_WHEEL = 22, +} + +WeaponTypeGroups = { + MELEE = 2685387236, + HANDGUN = 416676503, + SMG = -957766203, + SHOTGUN = 860033945, + RIFLE = 970310034, + LMG = 1159398588, + SNIPER = 3082541095, + HEAVY = 2725924767, + THROWABLE = 1548507267, + MISC = 4257178988, +} + +return { + + debug = true, -- Set to true for development purposes only. Used for zones, and essential prints. Will be removed upon release + + vehicleMaximumLockingDistance = 5.0, -- Minimum distance for vehicle locking + + -- NPC Vehicle Lock States + lockNPCDrivenCars = true, -- Lock state for NPC cars being driven by NPCs [true = locked, false = unlocked] + lockNPCParkedCars = true, -- Lock state for NPC parked cars [true = locked, false = unlocked] + + -- Lockpick Settings + removeNormalLockpickChance = { -- Chance to remove lockpick on fail by vehicle class + [VehicleClasses.COMPACTS] = 0.5, + [VehicleClasses.SEDANS] = 0.5, + [VehicleClasses.SUVS] = 0.5, + [VehicleClasses.COUPES] = 0.5, + [VehicleClasses.MUSCLE] = 0.5, + [VehicleClasses.SPORTS_CLASSICS] = 0.5, + [VehicleClasses.SPORTS] = 0.5, + [VehicleClasses.SUPER] = 0.5, + [VehicleClasses.MOTORCYCLES] = 0.5, + [VehicleClasses.OFF_ROAD] = 0.5, + [VehicleClasses.INDUSTRIAL] = 0.5, + [VehicleClasses.UTILITY] = 0.5, + [VehicleClasses.VANS] = 0.5, + [VehicleClasses.CYCLES] = 0.5, + [VehicleClasses.BOATS] = 0.5, + [VehicleClasses.HELICOPTERS] = 0.5, + [VehicleClasses.PLANES] = 0.5, + [VehicleClasses.SERVICE] = 0.5, + [VehicleClasses.EMERGENCY] = 0.5, + [VehicleClasses.MILITARY] = 0.5, + [VehicleClasses.COMMERCIAL] = 0.5, + [VehicleClasses.TRAINS] = 0.5, + [VehicleClasses.OPEN_WHEEL] = 0.5 + }, + removeAdvancedLockpickChance = { -- Chance to remove advanced lockpick on fail by vehicle class + [VehicleClasses.COMPACTS] = 0.5, + [VehicleClasses.SEDANS] = 0.5, + [VehicleClasses.SUVS] = 0.5, + [VehicleClasses.COUPES] = 0.5, + [VehicleClasses.MUSCLE] = 0.5, + [VehicleClasses.SPORTS_CLASSICS] = 0.5, + [VehicleClasses.SPORTS] = 0.5, + [VehicleClasses.SUPER] = 0.5, + [VehicleClasses.MOTORCYCLES] = 0.5, + [VehicleClasses.OFF_ROAD] = 0.5, + [VehicleClasses.INDUSTRIAL] = 0.5, + [VehicleClasses.UTILITY] = 0.5, + [VehicleClasses.VANS] = 0.5, + [VehicleClasses.CYCLES] = 0.5, + [VehicleClasses.BOATS] = 0.5, + [VehicleClasses.HELICOPTERS] = 0.5, + [VehicleClasses.PLANES] = 0.5, + [VehicleClasses.SERVICE] = 0.5, + [VehicleClasses.EMERGENCY] = 0.5, + [VehicleClasses.MILITARY] = 0.5, + [VehicleClasses.COMMERCIAL] = 0.5, + [VehicleClasses.TRAINS] = 0.5, + [VehicleClasses.OPEN_WHEEL] = 0.5 + }, + + -- Carjack Settings + carjackEnable = true, -- Enables the ability to carjack pedestrian vehicles, stealing them by pointing a weapon at them + carjackingTimeInMs = 7500, -- Time it takes to successfully carjack in miliseconds + delayBetweenCarjackingsInMs = 10000, -- Time before you can attempt another carjack in miliseconds + carjackChance = { -- Probability of successful carjacking based on weapon used + [WeaponTypeGroups.MELEE] = 0.0, + [WeaponTypeGroups.HANDGUN] = 0.5, + [WeaponTypeGroups.SMG] = 0.75, + [WeaponTypeGroups.SHOTGUN] = 0.90, + [WeaponTypeGroups.RIFLE] = 0.90, + [WeaponTypeGroups.LMG] = 0.99, + [WeaponTypeGroups.SNIPER] = 0.99, + [WeaponTypeGroups.HEAVY] = 0.99, + [WeaponTypeGroups.THROWABLE] = 0.0, + [WeaponTypeGroups.MISC] = 0.0, + }, + + -- Hotwire Settings + hotwireChance = { -- Chance for a successful hotwire by vehicle Class + [VehicleClasses.COMPACTS] = 0.5, + [VehicleClasses.SEDANS] = 0.5, + [VehicleClasses.SUVS] = 0.5, + [VehicleClasses.COUPES] = 0.5, + [VehicleClasses.MUSCLE] = 0.5, + [VehicleClasses.SPORTS_CLASSICS] = 0.5, + [VehicleClasses.SPORTS] = 0.5, + [VehicleClasses.SUPER] = 0.5, + [VehicleClasses.MOTORCYCLES] = 0.5, + [VehicleClasses.OFF_ROAD] = 0.5, + [VehicleClasses.INDUSTRIAL] = 0.5, + [VehicleClasses.UTILITY] = 0.5, + [VehicleClasses.VANS] = 0.5, + [VehicleClasses.CYCLES] = 0.5, + [VehicleClasses.BOATS] = 0.5, + [VehicleClasses.HELICOPTERS] = 0.5, + [VehicleClasses.PLANES] = 0.5, + [VehicleClasses.SERVICE] = 0.5, + [VehicleClasses.EMERGENCY] = 0.5, + [VehicleClasses.MILITARY] = 0.5, + [VehicleClasses.COMMERCIAL] = 0.5, + [VehicleClasses.TRAINS] = 0.5, + [VehicleClasses.OPEN_WHEEL] = 0.5 + }, + timeBetweenHotwires = 5000, -- Time in milliseconds between hotwire attempts + minHotwireTime = 20000, -- Minimum hotwire time in milliseconds + maxHotwireTime = 40000, -- Maximum hotwire time in milliseconds + + -- Police Alert Settings + alertCooldown = 10000, -- Cooldown period in milliseconds (10 seconds) + policeAlertChance = 0.75, -- Chance of alerting the police during the day + policeNightAlertChance = 0.50, -- Chance of alerting the police at night (times: 01-06) + + -- Job Settings + sharedKeys = { -- Share keys amongst employees. Employees can lock/unlock any job-listed vehicle + ['police'] = { -- Job name + requireOnduty = false, + vehicles = { + 'police', -- Vehicle model + 'police2', -- Vehicle model + } + }, + ['mechanic'] = { + requireOnduty = false, + vehicles = { + 'towtruck', + } + } + }, + + -- Vehicles that cannot be jacked + immuneVehicles = { + 'stockade' + }, + + -- Vehicles that will never lock example: + noLockVehicles = { + -- 'stockade' -- example + }, + + -- Weapons that cannot be used for carjacking + noCarjackWeapons = { + "WEAPON_UNARMED", + "WEAPON_KNIFE", + "WEAPON_NIGHTSTICK", + "WEAPON_HAMMER", + "WEAPON_BAT", + "WEAPON_CROWBAR", + "WEAPON_GOLFCLUB", + "WEAPON_BOTTLE", + "WEAPON_DAGGER", + "WEAPON_HATCHET", + "WEAPON_KNUCKLE", + "WEAPON_MACHETE", + "WEAPON_FLASHLIGHT", + "WEAPON_SWITCHBLADE", + "WEAPON_POOLCUE", + "WEAPON_WRENCH", + "WEAPON_BATTLEAXE", + "WEAPON_GRENADE", + "WEAPON_STOCKYBOMB", + "WEAPON_PROXIMITYMINE", + "WEAPON_BZGAS", + "WEAPON_MOLOTOV", + "WEAPON_FIREEXTINGUISHER", + "WEAPON_PETROLCAN", + "WEAPON_FLARE", + "WEAPON_BALL", + "WEAPON_SNOWBALL", + "WEAPON_SMOKEGRENADE", + -- Add more weapon names as needed + } +} \ No newline at end of file diff --git a/config/server.lua b/config/server.lua index e69de29..71cac79 100644 --- a/config/server.lua +++ b/config/server.lua @@ -0,0 +1,2 @@ +--- placeholder. Not yet implemented +return {} \ No newline at end of file diff --git a/config/shared.lua b/config/shared.lua index d85a234..71cac79 100644 --- a/config/shared.lua +++ b/config/shared.lua @@ -1,4 +1,2 @@ --- placeholder. Not yet implemented -return { - -} \ No newline at end of file +return {} \ No newline at end of file From 4d7211ecc09967f23e35934752d859ca61d1da37 Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 23:31:56 +0100 Subject: [PATCH 09/12] removed unimplemented config files, modified client to new config --- client/main.lua | 47 ++++++++++++++++++++++++----------------------- config/server.lua | 2 -- config/shared.lua | 2 -- 3 files changed, 24 insertions(+), 27 deletions(-) delete mode 100644 config/server.lua delete mode 100644 config/shared.lua diff --git a/client/main.lua b/client/main.lua index 80f5f98..6751f73 100644 --- a/client/main.lua +++ b/client/main.lua @@ -9,6 +9,7 @@ local alertSend = false local lastPickedVehicle = nil local usingAdvanced = false local isHotwiring = false +local config = require 'config.client' ----------------------- ---- Threads ---- @@ -26,7 +27,7 @@ CreateThread(function() local plate = GetPlate(entering) local driver = GetPedInVehicleSeat(entering, -1) - for _, veh in ipairs(Config.immuneVehicles) do + for _, veh in ipairs(config.immuneVehicles) do if GetEntityModel(entering) == joaat(veh) then carIsImmune = true end @@ -54,7 +55,7 @@ CreateThread(function() isTakingKeys = false end end - elseif Config.lockNPCDrivingCars then + elseif config.lockNPCDrivingCars then TriggerServerEvent('qb-vehiclekeys:server:setVehLockState', NetworkGetNetworkIdFromEntity(entering), 2) else TriggerServerEvent('qb-vehiclekeys:server:setVehLockState', NetworkGetNetworkIdFromEntity(entering), 1) @@ -70,7 +71,7 @@ CreateThread(function() end -- Parked car logic elseif driver == 0 and entering ~= lastPickedVehicle and not HasKeys(plate) and not isTakingKeys then - if Config.lockNPCParkedCars then + if config.lockNPCParkedCars then TriggerServerEvent('qb-vehiclekeys:server:setVehLockState', NetworkGetNetworkIdFromEntity(entering), 2) else TriggerServerEvent('qb-vehiclekeys:server:setVehLockState', NetworkGetNetworkIdFromEntity(entering), 1) @@ -96,12 +97,12 @@ CreateThread(function() end end - if Config.carJackEnable and canCarjack then + if config.carJackEnable and canCarjack then local aiming, target = GetEntityPlayerIsFreeAimingAt(cache.playerId) if aiming and (target ~= nil and target ~= 0) then if DoesEntityExist(target) and IsPedInAnyVehicle(target, false) and not IsEntityDead(target) and not IsPedAPlayer(target) then local targetveh = GetVehiclePedIsIn(target) - for _, veh in ipairs(Config.immuneVehicles) do + for _, veh in ipairs(config.immuneVehicles) do if GetEntityModel(targetveh) == joaat(veh) then carIsImmune = true end @@ -123,7 +124,7 @@ end) function isBlacklistedVehicle(vehicle) local isBlacklisted = false - for _,v in ipairs(Config.noLockVehicles) do + for _,v in ipairs(config.noLockVehicles) do if joaat(v) == GetEntityModel(vehicle) then isBlacklisted = true break; @@ -281,9 +282,9 @@ end function AreKeysJobShared(veh) local vehName = GetDisplayNameFromVehicleModel(GetEntityModel(veh)) local vehPlate = GetVehicleNumberPlateText(veh) - for job, v in pairs(Config.sharedKeys) do + for job, v in pairs(config.sharedKeys) do if job == QBX.PlayerData.job.name then - if Config.sharedKeys[job].requireOnduty and not QBX.PlayerData.job.onduty then return false end + if config.sharedKeys[job].requireOnduty and not QBX.PlayerData.job.onduty then return false end for _, vehicle in pairs(v.vehicles) do if string.upper(vehicle) == string.upper(vehName) then if not HasKeys(vehPlate) then @@ -357,7 +358,7 @@ end function IsBlacklistedWeapon() local weapon = GetSelectedPedWeapon(cache.ped) if weapon ~= nil then - for _, v in pairs(Config.noCarjackWeapons) do + for _, v in pairs(config.noCarjackWeapons) do if weapon == joaat(v) then return true end @@ -409,18 +410,18 @@ function LockpickFinishCallback(success) end if usingAdvanced then - if chance <= Config.removeAdvancedLockpickChance[GetVehicleClass(vehicle)] then + if chance <= config.removeAdvancedLockpickChance[GetVehicleClass(vehicle)] then TriggerServerEvent("qb-vehiclekeys:server:breakLockpick", "advancedlockpick") end else - if chance <= Config.removeNormalLockpickChance[GetVehicleClass(vehicle)] then + if chance <= config.removeNormalLockpickChance[GetVehicleClass(vehicle)] then TriggerServerEvent("qb-vehiclekeys:server:breakLockpick", "lockpick") end end end function Hotwire(vehicle, plate) - local hotwireTime = math.random(Config.minHotwireTime, Config.maxHotwireTime) + local hotwireTime = math.random(config.minHotwireTime, config.maxHotwireTime) isHotwiring = true SetVehicleAlarm(vehicle, true) @@ -442,13 +443,13 @@ function Hotwire(vehicle, plate) } }) then StopAnimTask(cache.ped, "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", "machinic_loop_mechandplayer", 1.0) - if (math.random() <= Config.hotwireChance[GetVehicleClass(vehicle)]) then + if (math.random() <= config.hotwireChance[GetVehicleClass(vehicle)]) then TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate) else TriggerServerEvent('hud:server:GainStress', math.random(1, 4)) exports.qbx_core:Notify(Lang:t("notify.failed_lockedpick"), 'error') end - Wait(Config.timeBetweenHotwires) + Wait(config.timeBetweenHotwires) isHotwiring = false else StopAnimTask(cache.ped, "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", "machinic_loop_mechandplayer", 1.0) @@ -461,7 +462,7 @@ function Hotwire(vehicle, plate) end function CarjackVehicle(target) - if not Config.carJackEnable then return end + if not config.carJackEnable then return end isCarjacking = true canCarjack = false lib.requestAnimDict('mp_am_hold_up') @@ -487,7 +488,7 @@ function CarjackVehicle(target) end) if lib.progressCircle({ - duration = Config.carjackingTime, + duration = config.carjackingTime, label = Lang:t("progress.attempting_carjack"), position = 'bottom', useWhileDead = false, @@ -499,8 +500,8 @@ function CarjackVehicle(target) local hasWeapon, weaponHash = GetCurrentPedWeapon(cache.ped, true) if hasWeapon and isCarjacking then local carjackChance - if Config.carjackChance[tostring(GetWeapontypeGroup(weaponHash))] then - carjackChance = Config.carjackChance[tostring(GetWeapontypeGroup(weaponHash))] + if config.carjackChance[tostring(GetWeapontypeGroup(weaponHash))] then + carjackChance = config.carjackChance[tostring(GetWeapontypeGroup(weaponHash))] else carjackChance = 0.5 end @@ -527,28 +528,28 @@ function CarjackVehicle(target) isCarjacking = false Wait(2000) AttemptPoliceAlert("carjack") - Wait(Config.delayBetweenCarjackings) + Wait(config.delayBetweenCarjackings) canCarjack = true end else MakePedFlee(target) isCarjacking = false - Wait(Config.delayBetweenCarjackings) + Wait(config.delayBetweenCarjackings) canCarjack = true end end function AttemptPoliceAlert(type) if not alertSend then - local chance = Config.policeAlertChance + local chance = config.policeAlertChance if GetClockHours() >= 1 and GetClockHours() <= 6 then - chance = Config.policeNightAlertChance + chance = config.policeNightAlertChance end if math.random() <= chance then TriggerServerEvent('police:server:policeAlert', Lang:t("info.vehicle_theft") .. type) end alertSend = true - SetTimeout(Config.alertCooldown, function() + SetTimeout(config.alertCooldown, function() alertSend = false end) end diff --git a/config/server.lua b/config/server.lua deleted file mode 100644 index 71cac79..0000000 --- a/config/server.lua +++ /dev/null @@ -1,2 +0,0 @@ ---- placeholder. Not yet implemented -return {} \ No newline at end of file diff --git a/config/shared.lua b/config/shared.lua deleted file mode 100644 index 71cac79..0000000 --- a/config/shared.lua +++ /dev/null @@ -1,2 +0,0 @@ ---- placeholder. Not yet implemented -return {} \ No newline at end of file From 131eba915b851f4e2a621f46eca0e037569c1448 Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 23:32:34 +0100 Subject: [PATCH 10/12] removing old config.lua --- config.lua | 212 ----------------------------------------------------- 1 file changed, 212 deletions(-) delete mode 100644 config.lua diff --git a/config.lua b/config.lua deleted file mode 100644 index aa4df7e..0000000 --- a/config.lua +++ /dev/null @@ -1,212 +0,0 @@ -VehicleClasses = { - COMPACTS = 0, - SEDANS = 1, - SUVS = 2, - COUPES = 3, - MUSCLE = 4, - SPORTS_CLASSICS = 5, - SPORTS = 6, - SUPER = 7, - MOTORCYCLES = 8, - OFF_ROAD = 9, - INDUSTRIAL = 10, - UTILITY = 11, - VANS = 12, - CYCLES = 13, - BOATS = 14, - HELICOPTERS = 15, - PLANES = 16, - SERVICE = 17, - EMERGENCY = 18, - MILITARY = 19, - COMMERCIAL = 20, - TRAINS = 21, - OPEN_WHEEL = 22, -} - -WeaponTypeGroups = { - MELEE = 2685387236, - HANDGUN = 416676503, - SMG = -957766203, - SHOTGUN = 860033945, - RIFLE = 970310034, - LMG = 1159398588, - SNIPER = 3082541095, - HEAVY = 2725924767, - THROWABLE = 1548507267, - MISC = 4257178988, -} - -Config = { - debug = true, -- Set to true for development purposes only. Used for zones, and essential prints. Will be removed upon release - - vehicleMaximumLockingDistance = 5.0, -- Minimum distance for vehicle locking - - -- NPC Vehicle Lock States - lockNPCDrivenCars = true, -- Lock state for NPC cars being driven by NPCs [true = locked, false = unlocked] - lockNPCParkedCars = true, -- Lock state for NPC parked cars [true = locked, false = unlocked] - - -- Lockpick Settings - removeNormalLockpickChance = { -- Chance to remove lockpick on fail by vehicle class - [VehicleClasses.COMPACTS] = 0.5, - [VehicleClasses.SEDANS] = 0.5, - [VehicleClasses.SUVS] = 0.5, - [VehicleClasses.COUPES] = 0.5, - [VehicleClasses.MUSCLE] = 0.5, - [VehicleClasses.SPORTS_CLASSICS] = 0.5, - [VehicleClasses.SPORTS] = 0.5, - [VehicleClasses.SUPER] = 0.5, - [VehicleClasses.MOTORCYCLES] = 0.5, - [VehicleClasses.OFF_ROAD] = 0.5, - [VehicleClasses.INDUSTRIAL] = 0.5, - [VehicleClasses.UTILITY] = 0.5, - [VehicleClasses.VANS] = 0.5, - [VehicleClasses.CYCLES] = 0.5, - [VehicleClasses.BOATS] = 0.5, - [VehicleClasses.HELICOPTERS] = 0.5, - [VehicleClasses.PLANES] = 0.5, - [VehicleClasses.SERVICE] = 0.5, - [VehicleClasses.EMERGENCY] = 0.5, - [VehicleClasses.MILITARY] = 0.5, - [VehicleClasses.COMMERCIAL] = 0.5, - [VehicleClasses.TRAINS] = 0.5, - [VehicleClasses.OPEN_WHEEL] = 0.5 - }, - removeAdvancedLockpickChance = { -- Chance to remove advanced lockpick on fail by vehicle class - [VehicleClasses.COMPACTS] = 0.5, - [VehicleClasses.SEDANS] = 0.5, - [VehicleClasses.SUVS] = 0.5, - [VehicleClasses.COUPES] = 0.5, - [VehicleClasses.MUSCLE] = 0.5, - [VehicleClasses.SPORTS_CLASSICS] = 0.5, - [VehicleClasses.SPORTS] = 0.5, - [VehicleClasses.SUPER] = 0.5, - [VehicleClasses.MOTORCYCLES] = 0.5, - [VehicleClasses.OFF_ROAD] = 0.5, - [VehicleClasses.INDUSTRIAL] = 0.5, - [VehicleClasses.UTILITY] = 0.5, - [VehicleClasses.VANS] = 0.5, - [VehicleClasses.CYCLES] = 0.5, - [VehicleClasses.BOATS] = 0.5, - [VehicleClasses.HELICOPTERS] = 0.5, - [VehicleClasses.PLANES] = 0.5, - [VehicleClasses.SERVICE] = 0.5, - [VehicleClasses.EMERGENCY] = 0.5, - [VehicleClasses.MILITARY] = 0.5, - [VehicleClasses.COMMERCIAL] = 0.5, - [VehicleClasses.TRAINS] = 0.5, - [VehicleClasses.OPEN_WHEEL] = 0.5 - }, - - -- Carjack Settings - carjackEnable = true, -- Enables the ability to carjack pedestrian vehicles, stealing them by pointing a weapon at them - carjackingTimeInMs = 7500, -- Time it takes to successfully carjack in miliseconds - delayBetweenCarjackingsInMs = 10000, -- Time before you can attempt another carjack in miliseconds - carjackChance = { -- Probability of successful carjacking based on weapon used - [WeaponTypeGroups.MELEE] = 0.0, - [WeaponTypeGroups.HANDGUN] = 0.5, - [WeaponTypeGroups.SMG] = 0.75, - [WeaponTypeGroups.SHOTGUN] = 0.90, - [WeaponTypeGroups.RIFLE] = 0.90, - [WeaponTypeGroups.LMG] = 0.99, - [WeaponTypeGroups.SNIPER] = 0.99, - [WeaponTypeGroups.HEAVY] = 0.99, - [WeaponTypeGroups.THROWABLE] = 0.0, - [WeaponTypeGroups.MISC] = 0.0, - }, - - -- Hotwire Settings - hotwireChance = { -- Chance for a successful hotwire by vehicle Class - [VehicleClasses.COMPACTS] = 0.5, - [VehicleClasses.SEDANS] = 0.5, - [VehicleClasses.SUVS] = 0.5, - [VehicleClasses.COUPES] = 0.5, - [VehicleClasses.MUSCLE] = 0.5, - [VehicleClasses.SPORTS_CLASSICS] = 0.5, - [VehicleClasses.SPORTS] = 0.5, - [VehicleClasses.SUPER] = 0.5, - [VehicleClasses.MOTORCYCLES] = 0.5, - [VehicleClasses.OFF_ROAD] = 0.5, - [VehicleClasses.INDUSTRIAL] = 0.5, - [VehicleClasses.UTILITY] = 0.5, - [VehicleClasses.VANS] = 0.5, - [VehicleClasses.CYCLES] = 0.5, - [VehicleClasses.BOATS] = 0.5, - [VehicleClasses.HELICOPTERS] = 0.5, - [VehicleClasses.PLANES] = 0.5, - [VehicleClasses.SERVICE] = 0.5, - [VehicleClasses.EMERGENCY] = 0.5, - [VehicleClasses.MILITARY] = 0.5, - [VehicleClasses.COMMERCIAL] = 0.5, - [VehicleClasses.TRAINS] = 0.5, - [VehicleClasses.OPEN_WHEEL] = 0.5 - }, - timeBetweenHotwires = 5000, -- Time in milliseconds between hotwire attempts - minHotwireTime = 20000, -- Minimum hotwire time in milliseconds - maxHotwireTime = 40000, -- Maximum hotwire time in milliseconds - - -- Police Alert Settings - alertCooldown = 10000, -- Cooldown period in milliseconds (10 seconds) - policeAlertChance = 0.75, -- Chance of alerting the police during the day - policeNightAlertChance = 0.50, -- Chance of alerting the police at night (times: 01-06) - - -- Job Settings - sharedKeys = { -- Share keys amongst employees. Employees can lock/unlock any job-listed vehicle - ['police'] = { -- Job name - requireOnduty = false, - vehicles = { - 'police', -- Vehicle model - 'police2', -- Vehicle model - } - }, - ['mechanic'] = { - requireOnduty = false, - vehicles = { - 'towtruck', - } - } - }, - - -- Vehicles that cannot be jacked - immuneVehicles = { - 'stockade' - }, - - -- Vehicles that will never lock - noLockVehicles = { - - }, - - -- Weapons that cannot be used for carjacking - noCarjackWeapons = { - "WEAPON_UNARMED", - "WEAPON_KNIFE", - "WEAPON_NIGHTSTICK", - "WEAPON_HAMMER", - "WEAPON_BAT", - "WEAPON_CROWBAR", - "WEAPON_GOLFCLUB", - "WEAPON_BOTTLE", - "WEAPON_DAGGER", - "WEAPON_HATCHET", - "WEAPON_KNUCKLE", - "WEAPON_MACHETE", - "WEAPON_FLASHLIGHT", - "WEAPON_SWITCHBLADE", - "WEAPON_POOLCUE", - "WEAPON_WRENCH", - "WEAPON_BATTLEAXE", - "WEAPON_GRENADE", - "WEAPON_STOCKYBOMB", - "WEAPON_PROXIMITYMINE", - "WEAPON_BZGAS", - "WEAPON_MOLOTOV", - "WEAPON_FIREEXTINGUISHER", - "WEAPON_PETROLCAN", - "WEAPON_FLARE", - "WEAPON_BALL", - "WEAPON_SNOWBALL", - "WEAPON_SMOKEGRENADE", - -- Add more weapon names as needed - } -} From 0ba2eb47283b98e87402227ad5479cf9554a6f2b Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 23:33:56 +0100 Subject: [PATCH 11/12] modifying fxmanifest based on new config --- fxmanifest.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fxmanifest.lua b/fxmanifest.lua index 7761937..f6bdb9c 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -10,14 +10,13 @@ shared_scripts { '@qbx_core/modules/utils.lua', '@qbx_core/shared/locale.lua', 'locales/en.lua', - 'locales/*.lua', - 'config.lua', - 'shared/functions.lua' + 'locales/*.lua' } client_scripts { '@qbx_core/modules/playerdata.lua', 'client/main.lua', + 'config/client.lua' } server_script 'server/main.lua' From bbd90f05bb72b07ca6f765170ddbf534fdb5d684 Mon Sep 17 00:00:00 2001 From: adweex Date: Sat, 18 Nov 2023 23:36:57 +0100 Subject: [PATCH 12/12] fxmanifest config file wrong placement fix --- fxmanifest.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fxmanifest.lua b/fxmanifest.lua index f6bdb9c..e34190b 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -15,7 +15,10 @@ shared_scripts { client_scripts { '@qbx_core/modules/playerdata.lua', - 'client/main.lua', + 'client/main.lua' +} + +files { 'config/client.lua' }