Tutorials
1.
---@param vehicle integer
---@param status Optional[integer] (1 || 2)
exports.fivecode_carkeys:ToggleLock(vehicle, status)-- For example in ox_target
exports.ox_target:addGlobalVehicle({
{
name = 'ox_target:driverF',
icon = 'fa-solid fa-car-side',
label = 'Toggle Lock Vehicle',
bones = { 'bodyshell' },
canInteract = function(entity, distance, coords, name)
local boneId = GetEntityBoneIndexByName(entity, 'door_dside_f')
if boneId ~= -1 then
return #(coords - GetWorldPositionOfEntityBone(entity, boneId)) < 0.5 or #(coords - GetWorldPositionOfEntityBone(entity, GetEntityBoneIndexByName(entity, 'seat_dside_f'))) < 0.72
end
end,
onSelect = function(data)
exports.fivecode_carkeys:ToggleLock(data.entity)
end
}
})2.
3.
4.
5.
Last updated