altv-issues
altv-issues copied to clipboard
Peds and set player into air vehicle crash
Description of the problem
Game crashes if you spawn more than 110 peds and put your player into any air vehicle, like hydra or maverick
Reproduction steps
- run the following code:
- spawn air vehicle, like hydra
- set your player into spawned vehicle with
player.setIntoVehicleornative.setPedIntoVehicle
const { pos, model } = alt.Player.local
for (let i = 0; i < 110; ++i) {
const coords = {
x: pos.x + (Math.random() * 5.0),
y: pos.y + (Math.random() * 5.0),
z: pos.z,
}
const ped = native.createPed(
0,
model,
coords.x,
coords.y,
coords.z,
0,
false, false,
)
native.freezeEntityPosition(ped, true) // without this line my game may crash
alt.log("created ped:", i)
await alt.Utils.wait(0)
}
Expected behaviour
/
Additional context
No response
Operating system
Windows 11
Version
release/10.5
Too many physics calculations cause the game to crash, same thing happens with objects etc. too
the cause of this crash is player.setIntoVehicle
upd: native.setPedIntoVehicle crashes too
Can confirm it sometimes crashing on 110, but always between 110 - 120 Maybe dependend on the location where the peds are spawned (e.g. like having more or less physic calculations in that area as leon said?)
@deluvas1911 if this depends on physic calculations why doesn't putting a player in a car cause a crash? this crash is somehow related to air vehicle
Shouldn't always type 2 be used for createPed?
Shouldn't always type 2 be used for createPed?
no, xd https://discord.com/channels/371265202378899476/557307592129511444/978377544296435742

Have you tried delaying ped spawns? Like only one ped every second.
i spawn them one ped per frame, there is await alt.Utils.wait(0) in repro code
Fixed since some gta or alt:V update