Skip to content

Commit

Permalink
fix+refactor:( fix spawn ped smaller rebuild)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Dec 30, 2022
1 parent 1d3263f commit 22d0d99
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions server-data/resources/[bpt_addons]/bpt_ped/client/main.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
-- Digital Store
Citizen.CreateThread(function()

local ped = CreatePed(4, GetHashKey("s_f_y_clubbar_01"), 383.762634, -826.681335, 28.300000, false, true)
FreezeEntityPosition(ped, true)
SetEntityHeading(ped, 260.0 )
SetEntityInvincible(ped, true)
SetBlockingOfNonTemporaryEvents(ped, true)
Citizen.CreateThread(function() -- Example

local ped_hash = 0x5B3BD90D -- Ped Hash
local ped_coords = { x = 383.762634, y = -826.681335, z = 28.300000, h = 260.0 } -- Ped Coords

RequestModel(ped_hash)
while not HasModelLoaded(ped_hash) do
Citizen.Wait(1)
end

ped_info = CreatePed(1, ped_hash, ped_coords.x, ped_coords.y, ped_coords.z, ped_coords.h, false, true)
SetBlockingOfNonTemporaryEvents(ped_info, true) -- Don't Change
SetPedDiesWhenInjured(ped_info, false) -- Can Die?
SetPedCanPlayAmbientAnims(ped_info, true) -- Don't Change
SetPedCanRagdollFromPlayerImpact(ped_info, false) -- Ped Fall Down
SetEntityInvincible(ped_info, true) -- Ped Invincible
FreezeEntityPosition(ped_info, true) -- Don't Change
TaskStartScenarioInPlace(ped_info, "WORLD_HUMAN_COP_IDLES", 0, true); -- Ped Anim

end)

0 comments on commit 22d0d99

Please sign in to comment.