Disable collision between player car and other cars

Hello Hello !

So, I rarely use the forum to ask for help, but today, after a lot of inconclusive attempts, I come to you.

I would like to know if it is possible to make the collision between a player’s vehicle and other vehicles (static or moving, a bit like passive mode in GTA Online), cause i’m making racing server, and I think this is a more than important feature, especially in time trial races, for example.

So, so far I have just found some information about the following function:


So I tried several things, including the following example:

SetEntityNoCollisionEntity(GetVehiclePedIsIn, otherVehicle, false)

SetEntityNoCollisionEntity(GetVehiclePedIsIn, otherVehicle, true)

But, unfortunately, nothing works. Do you have any suggestions ?

Thanks in advance for your time !

Works when used properly.

for _, i in ipairs(GetActivePlayers()) do
      if i ~= PlayerId() then
        local closestPlayerPed = GetPlayerPed(i)
        local veh = GetVehiclePedIsIn(closestPlayerPed, false)
        SetEntityNoCollisionEntity(veh, GetVehiclePedIsIn(GetPlayerPed(-1), false), false)
1 Like

We’re not all equally good, but well, thanks, i guess ? :face_with_raised_eyebrow:

how can i used properly ?