How to separate players in one session

Any ideas how to split players from each other in one session?
Let me explain.
It is a kind of virual wolds in other gta multyplayers.
I saw this in gta online, houses f.e. Same interior, same server. Players are invisible for each others. I can invite people in my house and my friend can invite people in the same int.

I tried to use SetEntityVisible(GetPlayerPed(i), false) and it is works for a short time and in every tick.
But players still had collision.

1 Like

Maybe there is a special native to separate players? Im beating bricks on native-db, but with no result.

Coudln’t you just disable the entity collision?

SetEntityCollision(entity, bool toggle, bool keepPhysics)

that would make the player fall thru the world or able to noclip thru the walls and everything i am also looking for a way to make interiors separate this is how i do it

Citizen.CreateThread(function()
 while true do
 Citizen.Wait(0)
  for i = 0, 25 do
  if DoesEntityExist(GetPlayerPed(i)) and PlayerId() ~= i then
    playerID = i
  if not DoesEntityExist(GetPlayerPed(i)) and DoesEntityExist(GetPlayerPed(PlayerId())) then 
    SetPlayerInvisibleLocally(PlayerId(),  true)
  end
  end  
    if GetPlayerPed(playerID) ~= GetPlayerPed(PlayerId()) and GetInteriorFromEntity(GetPlayerPed(playerID)) == 258561 then
      SetPlayerInvisibleLocally(playerID,  true)
    end
	if GetInteriorFromEntity(GetPlayerPed(playerID)) == 258561 then	        	
	 SetPlayerInvisibleLocally(playerID,  false)
	end  
  end  
 end
end)

same issue as the OP i can still collide with and hear the other player

but i can make the veh separate

	  if not DoesEntityExist(buggyA) then
       buggyA = CreateVehicle(-769147461, 887.824, -3236.251, -98.8946, 0.0, 0, 0)
	            SetNetworkIdExistsOnAllMachines(NetworkGetNetworkIdFromEntity(buggyA), 0)
		    NetworkSetEntityVisibleToNetwork(buggyA, 0)
  	            SetVehicleExtra(buggyA, 1, false)
	            SetVehicleExtra(buggyA, 2, false)
		    SetVehicleExtra(buggyA, 3, false)
     end

sadly this dont work on players that would fix it for sure

SetNetworkIdExistsOnAllMachines(NetworkGetNetworkIdFromEntity(buggyA), 0)

Have you tried SET_ENTITY_NO_COLLISION_ENTITY?
Have not tried it with other player’s peds, but with an NPC ped it gives the requested no collision :slight_smile:

kool that works i used

SetEntityNoCollisionEntity(GetPlayerPed(playerID), GetPlayerPed(PlayerId()), 0)
1 Like

the next thing is sounds i think

Except you still can see how other players open/close doors or ride vehicles