Merge pull request #1062 from bfivem/main

refactor: small optimization
This commit is contained in:
Kakarot
2024-02-10 17:41:33 -05:00
committed by GitHub
4 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ end)
RegisterNetEvent('QBCore:Command:SpawnVehicle', function(vehName)
local ped = PlayerPedId()
local hash = GetHashKey(vehName)
local hash = joaat(vehName)
local veh = GetVehiclePedIsUsing(ped)
if not IsModelInCdimage(hash) then return end
RequestModel(hash)
+2 -2
View File
@@ -434,7 +434,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)
@@ -447,7 +447,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