target system custom
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
local Bones = {Options = {}, Vehicle = {'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', 'platelight', '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', 'seat_dside_f', 'seat_pside_f', 'Gun_Nuzzle', 'seat_r'}}
|
||||
|
||||
if Config.EnableDefaultOptions then
|
||||
local BackEngineVehicles = {
|
||||
[`ninef`] = true,
|
||||
[`adder`] = true,
|
||||
[`vagner`] = true,
|
||||
[`t20`] = true,
|
||||
[`infernus`] = true,
|
||||
[`zentorno`] = true,
|
||||
[`reaper`] = true,
|
||||
[`comet2`] = true,
|
||||
[`comet3`] = true,
|
||||
[`jester`] = true,
|
||||
[`jester2`] = true,
|
||||
[`cheetah`] = true,
|
||||
[`cheetah2`] = true,
|
||||
[`prototipo`] = true,
|
||||
[`turismor`] = true,
|
||||
[`pfister811`] = true,
|
||||
[`ardent`] = true,
|
||||
[`nero`] = true,
|
||||
[`nero2`] = true,
|
||||
[`tempesta`] = true,
|
||||
[`vacca`] = true,
|
||||
[`bullet`] = true,
|
||||
[`osiris`] = true,
|
||||
[`entityxf`] = true,
|
||||
[`turismo2`] = true,
|
||||
[`fmj`] = true,
|
||||
[`re7b`] = true,
|
||||
[`tyrus`] = true,
|
||||
[`italigtb`] = true,
|
||||
[`penetrator`] = true,
|
||||
[`monroe`] = true,
|
||||
[`ninef2`] = true,
|
||||
[`stingergt`] = true,
|
||||
[`surfer`] = true,
|
||||
[`surfer2`] = true,
|
||||
[`gp1`] = true,
|
||||
[`autarch`] = true,
|
||||
[`tyrant`] = true
|
||||
}
|
||||
|
||||
local function ToggleDoor(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
|
||||
|
||||
Bones.Options['seat_dside_f'] = {
|
||||
["Toggle Front Door"] = {
|
||||
icon = "fas fa-door-open",
|
||||
label = "Toggle Front Door",
|
||||
canInteract = function(entity)
|
||||
return GetEntityBoneIndexByName(entity, 'door_dside_f') ~= -1
|
||||
end,
|
||||
action = function(entity)
|
||||
ToggleDoor(entity, 0)
|
||||
end,
|
||||
distance = 1.2
|
||||
}
|
||||
}
|
||||
|
||||
Bones.Options['seat_pside_f'] = {
|
||||
["Toggle Front Door"] = {
|
||||
icon = "fas fa-door-open",
|
||||
label = "Toggle Front Door",
|
||||
canInteract = function(entity)
|
||||
return GetEntityBoneIndexByName(entity, 'door_pside_f') ~= -1
|
||||
end,
|
||||
action = function(entity)
|
||||
ToggleDoor(entity, 1)
|
||||
end,
|
||||
distance = 1.2
|
||||
}
|
||||
}
|
||||
|
||||
Bones.Options['seat_dside_r'] = {
|
||||
["Toggle Rear Door"] = {
|
||||
icon = "fas fa-door-open",
|
||||
label = "Toggle Rear Door",
|
||||
canInteract = function(entity)
|
||||
return GetEntityBoneIndexByName(entity, 'door_dside_r') ~= -1
|
||||
end,
|
||||
action = function(entity)
|
||||
ToggleDoor(entity, 2)
|
||||
end,
|
||||
distance = 1.2
|
||||
}
|
||||
}
|
||||
|
||||
Bones.Options['seat_pside_r'] = {
|
||||
["Toggle Rear Door"] = {
|
||||
icon = "fas fa-door-open",
|
||||
label = "Toggle Rear Door",
|
||||
canInteract = function(entity)
|
||||
return GetEntityBoneIndexByName(entity, 'door_pside_r') ~= -1
|
||||
end,
|
||||
action = function(entity)
|
||||
ToggleDoor(entity, 3)
|
||||
end,
|
||||
distance = 1.2
|
||||
}
|
||||
}
|
||||
|
||||
Bones.Options['bonnet'] = {
|
||||
["Toggle Hood"] = {
|
||||
icon = "fa-duotone fa-engine",
|
||||
label = "Toggle Hood",
|
||||
action = function(entity)
|
||||
ToggleDoor(entity, BackEngineVehicles[GetEntityModel(entity)] and 5 or 4)
|
||||
end,
|
||||
distance = 0.9
|
||||
}
|
||||
}
|
||||
|
||||
Bones.Options['boot'] = {
|
||||
["Toggle Trunk"] = {
|
||||
icon = "fas fa-truck-ramp-box",
|
||||
label = "Toggle Trunk",
|
||||
action = function(entity)
|
||||
ToggleDoor(entity, BackEngineVehicles[GetEntityModel(entity)] and 4 or 5)
|
||||
end,
|
||||
distance = 0.9
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
return Bones
|
||||
@@ -0,0 +1,70 @@
|
||||
local currentResourceName = GetCurrentResourceName()
|
||||
local targeting = exports[currentResourceName]
|
||||
|
||||
AddEventHandler(currentResourceName..':debug', function(data)
|
||||
print('Entity: '..data.entity, 'Model: '..GetEntityModel(data.entity), 'Type: '..GetEntityType(data.entity))
|
||||
if data.remove then
|
||||
targeting:RemoveTargetEntity(data.entity, 'Hello World')
|
||||
else
|
||||
targeting:AddTargetEntity(data.entity, {
|
||||
options = {
|
||||
{
|
||||
type = "client",
|
||||
event = currentResourceName..':debug',
|
||||
icon = "fas fa-box-circle-check",
|
||||
label = "Hello World",
|
||||
remove = true
|
||||
},
|
||||
},
|
||||
distance = 3.0
|
||||
})
|
||||
end
|
||||
end)
|
||||
|
||||
targeting:AddGlobalPed({
|
||||
options = {
|
||||
{
|
||||
type = "client",
|
||||
event = currentResourceName..':debug',
|
||||
icon = "fas fa-male",
|
||||
label = "(Debug) Ped",
|
||||
},
|
||||
},
|
||||
distance = Config.MaxDistance
|
||||
})
|
||||
|
||||
targeting:AddGlobalVehicle({
|
||||
options = {
|
||||
{
|
||||
type = "client",
|
||||
event = currentResourceName..':debug',
|
||||
icon = "fas fa-car",
|
||||
label = "(Debug) Vehicle",
|
||||
},
|
||||
},
|
||||
distance = Config.MaxDistance
|
||||
})
|
||||
|
||||
targeting:AddGlobalObject({
|
||||
options = {
|
||||
{
|
||||
type = "client",
|
||||
event = currentResourceName..':debug',
|
||||
icon = "fas fa-cube",
|
||||
label = "(Debug) Object",
|
||||
},
|
||||
},
|
||||
distance = Config.MaxDistance
|
||||
})
|
||||
|
||||
targeting:AddGlobalPlayer({
|
||||
options = {
|
||||
{
|
||||
type = "client",
|
||||
event = currentResourceName..':debug',
|
||||
icon = "fas fa-cube",
|
||||
label = "(Debug) Player",
|
||||
},
|
||||
},
|
||||
distance = Config.MaxDistance
|
||||
})
|
||||
Reference in New Issue
Block a user