forked from Simnation/Main
edit
This commit is contained in:
parent
be02d05ba8
commit
fc7ea910e9
35 changed files with 11992 additions and 1 deletions
24
resources/[tools]/mt_lib/modules/createPed/client.lua
Normal file
24
resources/[tools]/mt_lib/modules/createPed/client.lua
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue