mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-16 21:46:03 +01:00
feat(client/peds): disable collision between models
This commit is contained in:
@@ -101,6 +101,16 @@ local function updateBlips(playerGroups)
|
||||
end
|
||||
end
|
||||
|
||||
local function disableCollisionWithModels(ped, models)
|
||||
local coords = GetEntityCoords(ped)
|
||||
for i=1, #models do
|
||||
local m = models[i]
|
||||
local model = type(m) == "number" and m or GetHashKey(m)
|
||||
local obj = GetClosestObjectOfType(coords.x, coords.y, coords.z, 5.0, model, false, false, false)
|
||||
SetEntityNoCollisionEntity(ped, obj, false)
|
||||
end
|
||||
end
|
||||
|
||||
function NDCore.createAiPed(info)
|
||||
local ped
|
||||
local model = type(info.model) == "string" and GetHashKey(info.model) or info.model
|
||||
@@ -137,6 +147,7 @@ function NDCore.createAiPed(info)
|
||||
Wait(100)
|
||||
end
|
||||
|
||||
disableCollisionWithModels(ped, info.disableCollisionWithModels)
|
||||
configPed(ped)
|
||||
setClothing(ped, clothing)
|
||||
locations[id].ped = ped
|
||||
|
||||
Reference in New Issue
Block a user