1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-06-25 00:04:15 +02:00
parent be02d05ba8
commit fc7ea910e9
35 changed files with 11992 additions and 1 deletions

View file

@ -0,0 +1,24 @@
---@param coords table
---@param model string
---@param anim table
local createPed = function(coords, model, anim)
lib.requestModel(model, 5)
local ped = CreatePed(4, GetHashKey(model), coords.x, coords.y, coords.z, coords.w, false, true)
if DoesEntityExist(ped) then
SetEntityHeading(ped, coords.w)
FreezeEntityPosition(ped, true)
SetEntityInvincible(ped, true)
SetBlockingOfNonTemporaryEvents(ped, true)
if anim.scenario then
TaskStartScenarioInPlace(ped, anim.scenario, 0, true)
elseif anim.dict and anim.clip then
lib.requestAnimDict(anim.dict, 5)
TaskPlayAnim(ped, anim.dict, anim.clip, 8.0, 0.0, -1, 1, 0.0, 0, 0, 0)
end
return ped
else
print("Failed to create ped: " .. model)
return nil
end
end
exports("createPed", createPed)