This function
PlayPedAmbientSpeechNative()
Used to be called.
PlayAmbientSpeech1()
(They recently changed the name of the function.)
And it basically invokes the native _PLAY_AMBIENT_SPEECH1. Here is a link to the native document: https://vespura.com/doc/natives/?_0x8E04FEDD28D42462
The problem is even though it's in the natives document I cannot pass any parameters into it. I see that you have to give it a struct that holds the parameters in c++ but you can't do that in lua.
And here is a code example that spawn peds at pre-defined positions:
Citizen.CreateThread(function()
clerkHash = GetHashKey(store.ClerkModel)
pos = Config.Stores[1].pos
heading = Config.Stores[1].hdg
if IsModelInCdimage(clerkHash) and IsModelValid(clerkHash) then
RequestModel(clerkHash)
while not HasModelLoaded(clerkHash) do
RequestModel(clerkHash)
Wait(0)
end
clerk = CreatePed(clerkHash, pos.x, pos.y, pos.z, hdg, 1, 1, 0, 0)
SetModelAsNoLongerNeeded(clerkHash)
Citizen.InvokeNative(0x283978a15512b2fe, clerk, true) -- You can invoke natives like this too
end
end)