forked from Rexshack-RedM/rsg-target
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
181 lines (142 loc) · 5.19 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
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
-- Enable object highlight
Config.EnableObjectHighlight = 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 = {
}
Config.BoxZones = {
}
Config.PolyZones = {
}
Config.TargetBones = {
}
Config.TargetEntities = {
}
Config.EntityZones = {
}
Config.TargetModels = {
}
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 = "fa-duotone fa-door-open",
style = "",
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 = "fa-duotone fa-door-open",
style = "",
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 = "fa-duotone fa-door-open",
style = "",
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 = "fa-duotone fa-door-open",
style = "",
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",
style = "",
label = "Toggle Hood",
action = function(entity)
Config.ToggleDoor(entity, 4)
end
},
},
distance = 0.9
}
end
-------------------------------------------------------------------------------
return Config, Players, Types, Entities, Models, Zones, Bones, PlayerData
-------------------------------------------------------------------------------