-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetection.lua
More file actions
70 lines (63 loc) · 3.63 KB
/
detection.lua
File metadata and controls
70 lines (63 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
-------------------------------------------------------------------------------
-- Auto Detection Logic
-------------------------------------------------------------------------------
local function getFramework()
if GetResourceState('es_extended') == 'started' then return 'esx' end
if GetResourceState('qbx_core') == 'started' then return 'qbx' end
if GetResourceState('qb-core') == 'started' then return 'qb' end
if GetResourceState('ox_core') == 'started' then return 'ox_core' end
if GetResourceState('ND_Core') == 'started' then return 'nd_core' end
if GetResourceState('core') == 'started' then return 'tmc' end
return nil
end
local function getInventory()
if GetResourceState('ox_inventory') == 'started' then return 'ox_inventory' end
if GetResourceState('qb-inventory') == 'started' then return 'qb-inventory' end
if GetResourceState('qs-inventory') == 'started' then return 'qs-inventory' end
if GetResourceState('origen-inventory') == 'started' then return 'origen-inventory' end
if GetResourceState('tgiann-inventory') == 'started' then return 'tgiann-inventory' end
if GetResourceState('minventory') == 'started' then return 'codem-inventory' end
if GetResourceState('core_inventory') == 'started' then return 'core_inventory' end
if GetResourceState('ps-inventory') == 'started' then return 'ps-inventory' end
if GetResourceState('ak47_inventory') == 'started' then return 'ak47_inventory' end
return nil
end
local function getDatabase()
if GetResourceState('oxmysql') == 'started' then return 'oxmysql' end
if GetResourceState('mysql-async') == 'started' then return 'mysql-async' end
if GetResourceState('ghmattimysql') == 'started' and GetResourceState('oxmysql') == 'missing' then return 'ghmattimysql' end
return nil
end
local function getInteraction()
if GetResourceState('ox_target') == 'started' then return 'ox_target' end
if GetResourceState('qb-target') == 'started' then return 'qb-target' end
if GetResourceState('core_focus') == 'started' then return 'core_focus' end
return nil
end
local function getNotification()
if GetResourceState('ox_lib') == 'started' then return 'ox_lib' end
if GetResourceState('okokNotify') == 'started' then return 'okokNotify' end
if GetResourceState('mythic_notify') == 'started' then return 'mythic_notify' end
if GetResourceState('pNotify') == 'started' then return 'pNotify' end
if GetResourceState('17mov_Hud') == 'started' then return '17mov_Hud' end
if GetResourceState('codem-notification') == 'started' then return 'codem-notification' end
return 'standalone'
end
local function getTextUI()
if GetResourceState('ox_lib') == 'started' then return 'ox_lib' end
if GetResourceState('jg-textui') == 'started' then return 'jg-textui' end
if GetResourceState('okokTextUI') == 'started' then return 'okokTextUI' end
if GetResourceState('cd_drawtextui') == 'started' then return 'cd_drawtextui' end
if GetResourceState('codem-textui') == 'started' then return 'codem-textui' end
if GetResourceState('brutal_textui') == 'started' then return 'brutal_textui' end
return 'standalone'
end
return function(Config)
if Config.Framework == 'auto' then Config.Framework = getFramework() end
if Config.Inventory == 'auto' then Config.Inventory = getInventory() end
if Config.Database == 'auto' then Config.Database = getDatabase() end
if Config.Interaction == 'auto' then Config.Interaction = getInteraction() end
if Config.Notification == 'auto' then Config.Notification = getNotification() end
if Config.TextUI == 'auto' then Config.TextUI = getTextUI() end
return Config
end