Author Topic: Materializing Players  (Read 2744 times)

0 Members and 1 Guest are viewing this topic.

Offline someone920

  • Newbie
  • *
  • Posts: 47
  • Karma: 3
Materializing Players
« on: April 06, 2010, 01:07:36 PM »
Our server has a serious issue with the material tool, while we don't want to kick and ban people for it, we also don't want to restrict it. Is there anyway to stop players from materializing or players?

Offline Kenny_

  • Newbie
  • *
  • Posts: 29
  • Karma: 3
Re: Materializing Players
« Reply #1 on: April 06, 2010, 01:52:31 PM »
I've had the same problem on my server and ended up restricting it to guests, I never thought of using a script to prevent it from being used on players. I've just started scripting so I'm not sure if this will work:
Code: [Select]
function UseTool( ply, trace, toolmode )
if toolmode == "material" or toolmode == "colour" then
if trace.Entity:IsPlayer() then
return false
else
return true
end
end
end
 
hook.Add( "CanTool", "UseTool", UseTool )

Edit by Megiddo: Oops, accidentally hit edit instead of quote. Sorry about that!
« Last Edit: April 06, 2010, 02:10:36 PM by Megiddo »

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given