Context Menu GMod

Hi,

I can disable PropDrive for the context menu with the hook: “CanDrive” how can i disable Remove or filter the remove function in the context menu?

Thanks

Use CanProperty hook.



function GM:CanProperty( ply, property, ent )
	if (ent:GetName() == "StaticProp") and property == "remover" then return false end
end


It worked, after restart just got error ent:nil value so seems like filter dosent works?

Let’s be good coders here for a second and not override default functions.


function StaticPropRemove( ply, property, ent )
	if ent:GetName() == "StaticProp" and property == "remover" then return false end
end
hook.Add( "CanProperty", "UseHooksInstead", StaticPropRemove )

Thanks, done right :smiley:

Are you calling it serverside? ent:GetName() is serverside only.

Yeah i noticed that i need if SERVER, such fault at my side. I shame.