feat: Support for the latest Criminal Enterprises DLC

Enforce your gamemode to build `2699` to use them :)
This commit is contained in:
Mycroft
2022-08-01 02:09:13 +01:00
parent 33547981a6
commit 86bd59e98c
3 changed files with 38 additions and 2 deletions
+30
View File
@@ -963,3 +963,33 @@ Config.Weapons = {
{name = 'WEAPON_DIGISCANNER', label = _U('weapon_digiscanner'), components = {}},
{name = 'GADGET_PARACHUTE', label = _U('gadget_parachute'), components = {}}
}
local GameBuild = GetConvar("sv_enforceGameBuild", 1604)
-- The Criminal Enterprises DLC Weapons
if GameBuild >= 2699 then
local Length = #Config.Weapons
Config.Weapons[Length + 1] = {
name = 'WEAPON_TACTICALRIFLE',
label = _U('weapon_tactilerifle'),
ammo = {label = _U('ammo_rounds'), hash = GetHashKey("AMMO_RIFLE")},
tints = Config.DefaultWeaponTints,
components = {
{name = 'clip_default', label = _U('component_clip_default'), hash = GetHashKey("COMPONENT_TACTICALRIFLE_CLIP_01")},
{name = 'clip_extended', label = _U('component_clip_extended'), hash = GetHashKey("COMPONENT_TACTICALRIFLE_CLIP_02")},
{name = 'flashlight', label = _U('component_flashlight'), hash = GetHashKey("COMPONENT_AT_AR_FLSH_REH")},
{name = 'grip', label = _U('component_grip'), hash = GetHashKey("COMPONENT_AT_AR_AFGRIP")},
{name = 'suppressor', label = _U('component_suppressor'), hash = GetHashKey("COMPONENT_AT_AR_SUPP_02")}
}
}
Config.Weapons[Length + 2] = {
name = 'WEAPON_PRECISIONRIFLE',
label = _U('weapon_precisionrifle'),
ammo = {label = _U('ammo_rounds'), hash = GetHashKey("AMMO_SNIPER")},
tints = Config.DefaultWeaponTints,
components = {
{name = 'clip_default', label = _U('component_clip_default'), hash = GetHashKey("COMPONENT_PRECISIONRIFLE_CLIP_01")},
}
}
Config.Weapons[Length+ 3] = {name = 'WEAPON_METALDETECTOR', label = _U('weapon_metaldetector'), components = {}}
end
+5
View File
@@ -208,6 +208,11 @@ Locales['en'] = {
['weapon_rpg'] = 'Rocket Launcher',
['weapon_rayminigun'] = 'Widowmaker',
-- Criminal Enterprises DLC
['weapon_metaldetector'] = 'Metal Detector',
['weapon_precisionrifle'] = 'Precision Rifle',
['weapon_tactilerifle'] = 'Service Carbine',
-- Thrown
['weapon_ball'] = 'Baseball',
['weapon_bzgas'] = 'BZ Gas',
+3 -2
View File
@@ -19,11 +19,12 @@ end, true, {help = _U('command_setjob'), validate = true, arguments = {
}})
ESX.RegisterCommand('car', 'admin', function(xPlayer, args, showError)
if not args.car then args.car = "Prototipo" end
local GameBuild = tonumber(GetConvar("sv_enforceGameBuild", 1604))
if not args.car then args.car = GameBuild >= 2699 and "DRAUGUR" or "Prototipo" end
xPlayer.triggerEvent('esx:spawnVehicle', args.car)
end, false, {help = _U('command_car'), validate = false, arguments = {
{name = 'car', help = _U('command_car_car'), type = 'any'}
}})
}})
ESX.RegisterCommand({'cardel', 'dv'}, 'admin', function(xPlayer, args, showError)
if not args.radius then args.radius = 4 end