Stop the networking of players?

So I am working on a PropKill gamemode but want to be able to create custom lobbies inside the map.

I looked at https://wiki.garrysmod.com/page/Entity/SetPreventTransmit but that function doesn’t seem to exist anymore :frowning:

I can’t set model scale or set the alpha of the player, I need to stop them from being sent to certain clients all together otherwise esps would pickup on people who are in a different lobby.

Thanks, Hackcraft.

Maybe i misunderstand what lobby means for u. What you really want? Can you explain?

AFAIK you can’t. I’ve tried similar before.

Why do you care if other players see who is in a certain lobby?

You can set lobby number to each player and if number ~= number then dont allow damage. Also, you can change alpha of players from other lobbies.

(Waiting for dumb from dummy Sir TE5T)

What I mean by lobbies is that people will all be using the same map however the people in different lobbies will be playing their own mode.

For example player1 and player2 might be in the first lobby playing the practice mode.
Whereas player3 and player4 might be in the second lobby playing an intense 1v1.

I don’t want players from one lobby to clash with the others lobbies as I only have one map. Everything else but stopping certain players from being networked to the other lobby seems simple.
Now the reason for not wanting to set the alpha or anything like that is because people run esps in propkill and they’d cause them to see player’s they don’t need to see!

Did you try detouring player.GetAll?

The only thing you can do is set reserve seperate spaces of the map for these two lobbies, remove props that are detected in the other lobbies from the opposite lobby. (For people pushing props into the other lobby)

If you want a bunch of people on the same map with the same space but a different lobby then good luck.

That’s clientside and these are propkillers, more of them will have load priority, and it just wouldn’t work.

what i would do is make a map in hammer and then copy and paste if 4 times or however many times you want and then just have players get sent to the different coords after picking a mode

] lua_run print( debug.getregistry().Entity.SetPreventTransmit )
> print( debug.getregistry().Entity.SetPreventTransmit )…
function: 0x21757a88

Function still exists?

Can confirm SetPreventTransmit still exists. I actually have a working “PVS” system right now - however as a pro-tip, I have had strange issues where it slowly causes FPS to drop.

I haven’t been able to pin-point the cause exactly, but it seems to be when you stop transmitting some certain stuff. Iirc it’s one of these: https://drizzy.vip/i/51o34.txt
If anyone knows about this actually I’d appriciate the info.

Not transmitting worldspawn or gmod_gamerules might cause the pointer to constantly be recreated, therefore causing a memory leak. Just a shot in the dark.

Oh, I thought it might have been removed because when I ran this, nothing happened. Can I not target players with it?
I just tested props and they work with it.



local me = player.GetBySteamID("STEAM_0:1:50714411")
me:PrintMessage(HUD_PRINTTALK, "running")
for k, v in ipairs(player.GetAll()) do
	if v == me then return end
	v:SetPreventTransmit(me, true)
end


Are you by any chance calling the function clientside?
The function only works serverside.

Using RunString to run it serverside.

Also, note that this wont disable collisions serverside between the respective entities. So you’ll need to account for that too or you’ll get pushed around if you’re stood in the same position as another player or prop - or try to walk through said player or prop

It doesn’t work on players.

In order to hide a player you need to hide all of the entities that the player carries with it. (Weapons, trails, hats etc.)


function RecursiveSetPreventTransmit(ent, ply, stopTransmitting)
	if IsValid(ent) and IsValid(ply) then
		ent:SetPreventTransmit(ply, stopTransmitting)
		local tab = ent:GetChildren()
		for i = 1, #tab do
			RecursiveSetPreventTransmit(tab[ i ], ply, stopTransmitting)
		end
	end
end

This works. Just be aware that if the player picks up weapons after calling this the player will be networked again.
SetPreventTransmit also does not prevent sounds from that entity from playing.

Didn’t GMod Tower have this? IIRC, all the suites were actually in the same physical space, but with instancing.

Sorry I didn’t get back sooner, thanks darkjacky but I just tried that and it didn’t work.



local me = player.GetBySteamID("STEAM_0:1:50714411")
local function RecursiveSetPreventTransmit(ent, ply, stopTransmitting)
	if IsValid(ent) and IsValid(ply) and ply != me then
		ent:SetPreventTransmit(ply, stopTransmitting)
		local tab = ent:GetChildren()
		for i = 1, #tab do
			RecursiveSetPreventTransmit(tab[ i ], ply, stopTransmitting)
		end
	end
end

for k, v in ipairs(player.GetAll()) do
	RecursiveSetPreventTransmit(v, me, true)
end




function StopTransmit( ent, ply, bool )
	if !ent or !ply then return end
	if !IsValid( ent ) or !IsValid( ply ) then return end
	
	if bool == nil then bool = false end
	
	for k,v in pairs( ent:GetChildren() ) do 
		v:SetTransmitWithParent( true ) 
	end
	
	ent:SetPreventTransmit( ply, bool )
end


Just tried this and it worked for me.