Patch removing player names through properties.

Hello there! Well, I found out about this a few months ago and even wrote my own system to “exploit” the properties system.
I would like to request that a pull be made to patch removing player names.

And I even have the full code to patch it:

First of all the remove.lua properties file can be found in garrysmod/lua/autorun/properties/remove.lua

Code before:

[lua]
AddCSLuaFile()

properties.Add( “remove”,
{
MenuLabel = “#remove”,
Order = 1000,
MenuIcon = “icon16/delete.png”,

Filter		=	function( self, ent, ply ) 
			
					if ( !gamemode.Call( "CanProperty", ply, "remover", ent ) ) then return false end
					if ( !IsValid( ent ) ) then return false end
					if ( ent:IsPlayer() ) then return false end
					return true 
				end,
				
Action		=	function( self, ent )

					self:MsgStart()
						net.WriteEntity( ent )
					self:MsgEnd()
					
				end,
				
Receive		=	function( self, length, player )
				
					local ent = net.ReadEntity()
					
					if ( !IsValid( ent ) ) then return false end
					if ( !IsValid( player ) ) then return false end
					if ( ent:IsPlayer() ) then return false end
					if ( !self:Filter( ent, player ) ) then return false end
					
					-- Remove all constraints (this stops ropes from hanging around)
					constraint.RemoveAll( ent )
					
					-- Remove it properly in 1 second
					timer.Simple( 1, function() if ( IsValid( ent ) ) then ent:Remove() end end )
					
					-- Make it non solid
					ent:SetNotSolid( true )
					ent:SetMoveType( MOVETYPE_NONE )
					ent:SetNoDraw( true )
					
					-- Send Effect
					local ed = EffectData()
						ed:SetEntity( ent )
					util.Effect( "entity_remove", ed, true, true )
					
					player:SendLua( "achievements.Remover()" );
					
				end	

});
[/lua]

Fixed code:

[lua]
AddCSLuaFile()

properties.Add( “remove”,
{
MenuLabel = “#remove”,
Order = 1000,
MenuIcon = “icon16/delete.png”,

Filter		=	function( self, ent, ply ) 
			
					if ( !gamemode.Call( "CanProperty", ply, "remover", ent ) ) then return false end
					if ( !IsValid( ent ) ) then return false end
					if ( ent:IsPlayer() ) then return false end
                                            if string.find(ent, "PlayerResource") then return false end

					return true 
				end,
				
Action		=	function( self, ent )

					self:MsgStart()
						net.WriteEntity( ent )
					self:MsgEnd()
					
				end,
				
Receive		=	function( self, length, player )
				
					local ent = net.ReadEntity()
					
					if ( !IsValid( ent ) ) then return false end
					if ( !IsValid( player ) ) then return false end
					if ( ent:IsPlayer() ) then return false end
					if ( !self:Filter( ent, player ) ) then return false end
					
					-- Remove all constraints (this stops ropes from hanging around)
					constraint.RemoveAll( ent )
					
					-- Remove it properly in 1 second
					timer.Simple( 1, function() if ( IsValid( ent ) ) then ent:Remove() end end )
					
					-- Make it non solid
					ent:SetNotSolid( true )
					ent:SetMoveType( MOVETYPE_NONE )
					ent:SetNoDraw( true )
					
					-- Send Effect
					local ed = EffectData()
						ed:SetEntity( ent )
					util.Effect( "entity_remove", ed, true, true )
					
					player:SendLua( "achievements.Remover()" );
					
				end	

});
[/lua]

And to reproduce on any server that allows clientside Lua:

[lua]
concommand.Add(“lolplayernames”, function()
for k,v in pairs(ents.GetAll()) do
if string.find(tostring(v), “Player”) then
net.Start(“properties”)
net.WriteUInt( util.NetworkStringToID( “remove” ), 32 )
net.WriteEntity( v )
net.SendToServer()
end
end
end)
[/lua]

In the mean time before this gets patched, have fun doing this on any server that doesn’t block this. (Gamemodes like “flood”, “propkill”, and about 1/5 of “sandbox”, etc.)

lol, my friend was asking me recently if I know anything about player names ‘going wild’

try using the ulx “remove” command?

So, uh, what is “if string.find(ent, “PlayerResource”) then return false end” and how is it fixing anything?