mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
fix(es_extended): Gamebuild now returns for all users
This commit is contained in:
@@ -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
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user