refactor: small optimization

This commit is contained in:
MoskalykA
2023-12-21 20:17:32 +01:00
parent b132f2963e
commit fb4cc3e113
4 changed files with 11 additions and 9 deletions
+2 -2
View File
@@ -343,7 +343,7 @@ function QBCore.Functions.GetBoneDistance(entity, boneType, boneIndex)
end
function QBCore.Functions.AttachProp(ped, model, boneId, x, y, z, xR, yR, zR, vertex)
local modelHash = type(model) == 'string' and GetHashKey(model) or model
local modelHash = type(model) == 'string' and joaat(model) or model
local bone = GetPedBoneIndex(ped, boneId)
QBCore.Functions.LoadModel(modelHash)
local prop = CreateObject(modelHash, 1.0, 1.0, 1.0, 1, 1, 0)
@@ -356,7 +356,7 @@ end
function QBCore.Functions.SpawnVehicle(model, cb, coords, isnetworked, teleportInto)
local ped = PlayerPedId()
model = type(model) == 'string' and GetHashKey(model) or model
model = type(model) == 'string' and joaat(model) or model
if not IsModelInCdimage(model) then return end
if coords then
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords