forked from qbcore-redm-framework/qbr-target
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
217 lines (184 loc) · 5.16 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
local Config, Players, Types, Entities, Models, Zones, Bones, PlayerData = {}, {}, {}, {}, {}, {}, {}, {}
Types[1], Types[2], Types[3] = {}, {}, {}
Config.VehicleBones = {'chassis', 'windscreen', 'seat_pside_r', 'seat_dside_r', 'bodyshell', 'suspension_lm', 'suspension_lr', 'platelight', 'attach_female', 'attach_male', 'bonnet', 'boot', 'chassis_dummy', 'chassis_Control', 'door_dside_f', 'door_dside_r', 'door_pside_f', 'door_pside_r', 'Gun_GripR', 'windscreen_f', 'VFX_Emitter', 'window_lf', 'window_lr', 'window_rf', 'window_rr', 'engine', 'gun_ammo', 'ROPE_ATTATCH', 'wheel_lf', 'wheel_lr', 'wheel_rf', 'wheel_rr', 'exhaust', 'overheat', 'misc_e', 'seat_dside_f', 'seat_pside_f', 'Gun_Nuzzle'}
Config.Toggle = false -- True: Toggle Target || False: Show Target While Holding L ALT
-------------------------------------------------------------------------------
-- Settings
-------------------------------------------------------------------------------
-- It's possible to interact with entities through walls so this should be low
Config.MaxDistance = 3.0
-- Enable debug options and distance preview
Config.Debug = false
-- Enable outlines around the entity you're looking at
Config.EnableOutline = false
-- Enable default options (Toggling vehicle doors)
Config.EnableDefaultOptions = false
-------------------------------------------------------------------------------
-- Target Configs
-------------------------------------------------------------------------------
-- These are all empty for you to fill in, refer to the wiki and .md files for help in filling these in
Config.CircleZones = {
["index"] = {
name = "test2",
coords = vector3(1337.39, -1304.32, 76.24),
radius = 1.02,
debugPoly = true,
options = {
{
type = "client",
event = "Test:Event",
icon = "fas fa-example",
label = "Test",
targeticon = "fas fa-hat-wizard",
action = function()
print('that works dude!')
end
}
},
distance = 2.5
},
}
Config.BoxZones = {
}
Config.PolyZones = {
}
Config.TargetBones = {
}
Config.TargetEntities = {
}
Config.EntityZones = {
}
Config.TargetModels = {
["ClothingValentine"] = {
name="ClothingValentine",
models = {
75028703,
293523278,
-51505783,
-546862027
},
options = {
{
type = "client",
icon = "fas fa-tshirt",
label = "Open Clothing Menu",
targeticon = "fas fa-eye",
action = function()
TriggerEvent('qb-clothing:client:openMenu', false, true)
end
},
{
type = "client",
icon = "fas fa-tshirt",
label = "Open Outfits Menu",
targeticon = "fas fa-eye",
action = function()
TriggerEvent('qb-clothing:client:openOutfit')
end
}
},
distance = 2.5
}
}
Config.PedOptions = {
}
Config.VehicleOptions = {
}
Config.ObjectOptions = {
}
Config.PlayerOptions = {
}
-------------------------------------------------------------------------------
-- Functions
-------------------------------------------------------------------------------
if Config.EnableDefaultOptions then
Config.ToggleDoor = function(vehicle, door)
if GetVehicleDoorLockStatus(vehicle) ~= 2 then
if GetVehicleDoorAngleRatio(vehicle, door) > 0.0 then
SetVehicleDoorShut(vehicle, door, false)
else
SetVehicleDoorOpen(vehicle, door, false)
end
end
end
end
-------------------------------------------------------------------------------
-- Default options
-------------------------------------------------------------------------------
if Config.EnableDefaultOptions then
Bones['seat_dside_f'] = {
options = {
{
icon = "fas fa-door-open",
label = "Toggle front Door",
canInteract = function(entity)
return GetEntityBoneIndexByName(entity, 'door_dside_f') ~= -1
end,
action = function(entity)
Config.ToggleDoor(entity, 0)
end
},
},
distance = 1.2
}
Bones['seat_pside_f'] = {
options = {
{
icon = "fas fa-door-open",
label = "Toggle front Door",
canInteract = function(entity)
return GetEntityBoneIndexByName(entity, 'door_pside_f') ~= -1
end,
action = function(entity)
Config.ToggleDoor(entity, 1)
end
},
},
distance = 1.2
}
Bones['seat_dside_r'] = {
options = {
{
icon = "fas fa-door-open",
label = "Toggle rear Door",
canInteract = function(entity)
return GetEntityBoneIndexByName(entity, 'door_dside_r') ~= -1
end,
action = function(entity)
Config.ToggleDoor(entity, 2)
end
},
},
distance = 1.2
}
Bones['seat_pside_r'] = {
options = {
{
icon = "fas fa-door-open",
label = "Toggle rear Door",
canInteract = function(entity)
return GetEntityBoneIndexByName(entity, 'door_pside_r') ~= -1
end,
action = function(entity)
Config.ToggleDoor(entity, 3)
end
},
},
distance = 1.2
}
Bones['bonnet'] = {
options = {
{
icon = "fa-duotone fa-engine",
label = "Toggle Hood",
action = function(entity)
Config.ToggleDoor(entity, 4)
end
},
},
distance = 0.9
}
end
-------------------------------------------------------------------------------
return Config, Players, Types, Entities, Models, Zones, Bones, PlayerData
-------------------------------------------------------------------------------