mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 03:01:34 +00:00
fix(client/functions): type checking for vectors (#430)
allows for cross scrt compatibility with newer functions
This commit is contained in:
+17
-10
@@ -62,17 +62,19 @@ function QBCore.Functions.CreateBlip(coords, sprite, display, scale, colour, sho
|
||||
if not coords or not sprite or not display or not scale or not colour or shortRange == nil or not title then
|
||||
print("Blip failed to create, most likely missed a setting, debug log: ")
|
||||
print("Coords: " .. coords .. " Sprite: " .. sprite .. " Display: " .. display .. " scale: " .. scale .. " shortRange: " .. shortRange .. " Title: " .. title .. " if you're attempting to use a blip without a title, use an empty string.")
|
||||
else
|
||||
blip = AddBlipForCoord(coords)
|
||||
SetBlipSprite(blip, sprite)
|
||||
SetBlipDisplay(blip, display)
|
||||
SetBlipScale(blip, scale)
|
||||
SetBlipColour(blip, colour)
|
||||
SetBlipAsShortRange(blip, shortRange)
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentString(title)
|
||||
EndTextCommandSetBlipName(blip)
|
||||
return
|
||||
end
|
||||
|
||||
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords
|
||||
blip = AddBlipForCoord(coords)
|
||||
SetBlipSprite(blip, sprite)
|
||||
SetBlipDisplay(blip, display)
|
||||
SetBlipScale(blip, scale)
|
||||
SetBlipColour(blip, colour)
|
||||
SetBlipAsShortRange(blip, shortRange)
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentString(title)
|
||||
EndTextCommandSetBlipName(blip)
|
||||
end
|
||||
|
||||
function QBCore.Functions.RequestAnimDict(animDict)
|
||||
@@ -403,6 +405,11 @@ function QBCore.Functions.GetPlate(vehicle)
|
||||
end
|
||||
|
||||
function QBCore.Functions.SpawnClear(coords, radius)
|
||||
if coords then
|
||||
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords
|
||||
else
|
||||
coords = GetEntityCoords(ped)
|
||||
end
|
||||
local vehicles = GetGamePool('CVehicle')
|
||||
local closeVeh = {}
|
||||
for i=1, #vehicles, 1 do
|
||||
|
||||
Reference in New Issue
Block a user