Fixed other players blinking when instanced and fixed the collision problem

Since now the invisibility is updated every frame, the collision is only removed in the same frame. I also noticed that the ped order was wrong, because players were colliding when they were in diferent instances.
This commit is contained in:
goncalobsccosta
2020-12-08 21:00:59 +00:00
committed by GitHub
parent 22b88b59b5
commit 6514da2f0c
+3 -3
View File
@@ -193,7 +193,7 @@ end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
Citizen.Wait(0)
local playerPed = PlayerPedId()
-- Hide all these players
@@ -203,7 +203,7 @@ Citizen.CreateThread(function()
if NetworkIsPlayerActive(player) then
local otherPlayerPed = GetPlayerPed(player)
SetEntityVisible(otherPlayerPed, false, false)
SetEntityNoCollisionEntity(playerPed, otherPlayerPed, false)
SetEntityNoCollisionEntity(otherPlayerPed, playerPed, true)
end
end
end
@@ -228,4 +228,4 @@ Citizen.CreateThread(function()
Citizen.Wait(500)
end
end
end)
end)