mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
@@ -347,6 +347,21 @@ function QBCore.Functions.GetClosestBone(entity, list)
|
||||
return bone, coords, distance
|
||||
end
|
||||
|
||||
function QBCore.Functions.GetBoneDistance(entity, Type, Bone)
|
||||
local bone
|
||||
|
||||
if Type == 1 then
|
||||
bone = GetPedBoneIndex(entity, Bone)
|
||||
else
|
||||
bone = GetEntityBoneIndexByName(entity, Bone)
|
||||
end
|
||||
|
||||
local boneCoords = GetWorldPositionOfEntityBone(entity, bone)
|
||||
local playerCoords = GetEntityCoords(PlayerPedId())
|
||||
|
||||
return #(boneCoords - playerCoords)
|
||||
end
|
||||
|
||||
-- Vehicle
|
||||
|
||||
function QBCore.Functions.SpawnVehicle(model, cb, coords, isnetworked)
|
||||
|
||||
Reference in New Issue
Block a user