Script & ADMIN

Hello, help me make this script to become admins.
Ie they could to Use Only admins.
Better Steamid
thank you

Excuse me for my english:rolleyes:

Script:



AddCSLuaFile()

properties.Add( "collision_off", 
{
	MenuLabel	=	"#collision_off",
	Order		=	1500,
	MenuIcon	=	"icon16/collision_off.png",
	
	Filter		=	function( self, ent, ply ) 

						if ( !IsValid( ent ) ) then return false end
						if ( ent:IsPlayer() ) then return false end
						if ( !gamemode.Call( "CanProperty", ply, "collision", ent ) ) then return false end
						if ( ent:GetCollisionGroup() == COLLISION_GROUP_WORLD ) 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 ( !self:Filter( ent, player ) ) then return end
	
						ent:SetCollisionGroup( COLLISION_GROUP_WORLD )

					end	

});


properties.Add( "collision_on", 
{
	MenuLabel	=	"#collision_on",
	Order		=	1500,
	MenuIcon	=	"icon16/collision_on.png",
	
	Filter		=	function( self, ent, ply ) 

						if ( !IsValid( ent ) ) then return false end
						if ( ent:IsPlayer() ) then return false end
						if ( !gamemode.Call( "CanProperty", ply, "collision", ent ) ) then return false end

						return ent:GetCollisionGroup() == COLLISION_GROUP_WORLD 

					end,
					
	Action		=	function( self, ent )
	
						self:MsgStart()
							net.WriteEntity( ent )
						self:MsgEnd()
						
					end,
					
	Receive		=	function( self, length, player )
					
						local ent = net.ReadEntity()
						if ( !self:Filter( ent, player ) ) then return end
	
						ent:SetCollisionGroup( COLLISION_GROUP_NONE )

					end	

});


You gotta use this hook:

It has an example, just replace the property you want to block.

Can be an example to my script?

We don’t code here for you, robotboy gave you an example about what you should do…

The code has an example if you click that link.



hook.Add( "CanProperty", "block_remover_property", function( ply, property, ent )
	if (  !ply:IsAdmin() && property == "remover" ) then return false end
end )


How to put this script on the server?

Here we give you links and point out some errors, we don’t make the script for you -_-