forked from overextended/ox_inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
105 lines (79 loc) · 2.93 KB
/
config.lua
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
-- This file is intended for setting default config values.
-- Modifying the values here changes the resource hash (requiring players to download everything again).
-- It's also just convenient to leave it alone for the sake of git source control.
-- Details will be added to the documentation at some point, but you can utilise it like so...
--[[
setr ox_inventory {
"locale": "en",
"qtarget": true,
"keys": [
"F2", "K", "TAB"
]
}
set ox_inventory_server {
"logs": true,
"pricevariation": false
}
add_principal group.admin ox_inventory
add_ace resource.ox_inventory command.add_principal allow
add_ace resource.ox_inventory command.remove_principal allow
ensure ox_inventory
]]
-- Save the file to the resource directory as ".cfg"
-- Replace 'ensure ox_inventory' in your 'server.cfg' with 'exec @ox_inventory/.cfg'
local function loadConvar(name)
local convar = json.decode(GetConvar(name, '{}'))
if type(convar) == 'nil' then
CreateThread(function()
error(('^1Convar setting `%s` is malformed, ensure you are using a valid JSON format.^0'):format(name))
end)
end
return convar or {}
end
local ox = loadConvar('ox_inventory')
ox = {
-- Enable support for es_extended (defaults to true, for now)
esx = ox.esx or true,
-- If vehicle plates are stored with a trailing space, set to false (i.e. `XXX 000 `)
trimplate = ox.trimplate or true,
-- Adds compatibility for qtarget (https://github.com/overextended/qtarget)
qtarget = ox.qtarget or false,
-- Number of slots in the player inventory
playerslots = ox.playerslots or 50,
-- Blurs the screen while the inventory is open
blurscreen = ox.blurscreen or true,
-- Reload empty weapons automatically
autoreload = ox.autoreload or true,
-- Enable sentry logging (this reports UI errors and general performance statistics to the Ox team, anonymously)
sentry = ox.sentry or true,
-- Set the keybinds for primary, secondary, and hotbar
keys = ox.keys or {
'F2', 'K', 'TAB'
},
enablekeys = ox.enablekeys or {
249
},
playerweight = ox.playerweight or 30000,
locale = ox.locale or 'en'
}
ox.resource = GetCurrentResourceName()
IsDuplicityVersion = IsDuplicityVersion()
if IsDuplicityVersion then
local server = loadConvar('ox_inventory_server')
-- Check the latest available release
ox.versioncheck = server.versioncheck or false
-- Removes stashes from the database if they haven't been used
ox.clearstashes = server.clearstashes or '6 MONTH'
-- Enables text-file logging
ox.logs = server.logs or false
-- Prices of items will fluctuate between 80% and 120%
ox.randomprice = server.randomprice or true
-- Police grade required to take items from evidence
ox.evidencegrade = server.evidencegrade or 2
-- Fills generated inventories with random items
ox.randomloot = server.randomloot or true
-- Minimum chance for an inventory to generate an item
ox.lootchance = server.lootchance or 50
_G.server = table.wipe(server)
else client = {} end
_G.ox = ox