fix: ai ped blips showWhenNear hide on spawn

This commit is contained in:
Andyyy7666
2025-08-13 18:17:44 +02:00
parent 3f20d0f918
commit 0bd76ed79f

View File

@@ -111,7 +111,7 @@ function NDCore.createAiPed(info)
local options = info.options local options = info.options
local blip = createBlip(coords, blipInfo) local blip = createBlip(coords, blipInfo)
local point = lib.points.new({ local point = lib.points.new({
coords = vec3(coords.x, coords.y, coords.z), coords = coords.xyz,
distance = info.distance or 25.0 distance = info.distance or 25.0
}) })
@@ -123,6 +123,10 @@ function NDCore.createAiPed(info)
resource = info.resource or GetInvokingResource() resource = info.resource or GetInvokingResource()
} }
if blip and blipInfo and blipInfo.showWhenNear and DoesBlipExist(blip) and #(GetEntityCoords(cache.ped)-coords.xyz) > point.distance then
SetBlipAlpha(blip, 0)
end
function point:onEnter() function point:onEnter()
local found, ground = GetGroundZFor_3dCoord(coords.x, coords.y, coords.z, true) local found, ground = GetGroundZFor_3dCoord(coords.x, coords.y, coords.z, true)
lib.requestModel(model) lib.requestModel(model)