fix(es_extended): Gamebuild now returns for all users

This commit is contained in:
Mycroft
2022-09-21 18:33:00 +01:00
parent d15414d0a7
commit 69342a678b
2 changed files with 37 additions and 5 deletions
+33 -5
View File
@@ -963,10 +963,37 @@ Config.Weapons = {
{name = 'WEAPON_DIGISCANNER', label = _U('weapon_digiscanner'), components = {}},
{name = 'GADGET_PARACHUTE', label = _U('gadget_parachute'), components = {}}
}
local GameBuild = tonumber(GetConvar("sv_enforceGameBuild", 1604))
-- The Criminal Enterprises DLC Weapons
if not IsDuplicityVersion() then
ESX.TriggerServerCallback('esx:getGameBuild', function(GameBuild)
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 = `AMMO_RIFLE`},
tints = Config.DefaultWeaponTints,
components = {
{name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_TACTICALRIFLE_CLIP_01`},
{name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_TACTICALRIFLE_CLIP_02`},
{name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH_REH`},
{name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`},
{name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}
}
}
Config.Weapons[Length + 2] = {
name = 'WEAPON_PRECISIONRIFLE',
label = _U('weapon_precisionrifle'),
ammo = {label = _U('ammo_rounds'), hash = `AMMO_SNIPER`},
tints = Config.DefaultWeaponTints,
components = {
{name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_PRECISIONRIFLE_CLIP_01`},
}
}
Config.Weapons[Length+ 3] = {name = 'WEAPON_METALDETECTOR', label = _U('weapon_metaldetector'), components = {}}
end
end)
else
local GameBuild = tonumber(GetConvar("sv_enforceGameBuild", 1604))
if GameBuild >= 2699 then
local Length = #Config.Weapons
Config.Weapons[Length + 1] = {
@@ -992,4 +1019,5 @@ Config.Weapons = {
}
}
Config.Weapons[Length+ 3] = {name = 'WEAPON_METALDETECTOR', label = _U('weapon_metaldetector'), components = {}}
end
end
end
+4
View File
@@ -595,6 +595,10 @@ ESX.RegisterServerCallback('esx:isUserAdmin', function(source, cb)
cb(Core.IsPlayerAdmin(source))
end)
ESX.RegisterServerCallback('esx:getGameBuild', function(source, cb)
cb(tonumber(GetConvar("sv_enforceGameBuild", 1604)))
end)
ESX.RegisterServerCallback('esx:getOtherPlayerData', function(source, cb, target)
local xPlayer = ESX.GetPlayerFromId(target)