CreateSpoofedPed
Creates a ped with spoofed creation semantics at the given position.
Syntax
Susano.CreateSpoofedPed(pedType, modelHash, x, y, z, heading, isNetwork, bScriptHostPed) -> ped
Parameters
pedType (int): Ped type ID.
modelHash (int): Ped model hash.
x, y, z (number): World coordinates.
heading (number): Yaw in degrees.
isNetwork (boolean): Create as a networked entity.
bScriptHostPed (boolean): Try to set script host for the ped.
Return(s)
ped (int): Entity handle. 0 on failure.
Example(s)
Citizen.CreateThread(function()
local mdl = GetHashKey("s_m_m_armoured_01")
RequestModel(mdl)
while not HasModelLoaded(mdl) do
Citizen.Wait(0)
end
local ped = Susano.CreateSpoofedPed(26, mdl, 215.0, -920.0, 30.0, 90.0, true, true)
if ped ~= 0 then
print("Ped created:", ped)
else
print("Create failed")
end
SetModelAsNoLongerNeeded(mdl)
end)