-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcan_tool.lua
More file actions
30 lines (24 loc) · 757 Bytes
/
can_tool.lua
File metadata and controls
30 lines (24 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
PLUGIN.name = "CanTool"
PLUGIN.author = "STEAM_0:1:29606990"
PLUGIN.description = "Overwrite CanTool method"
local NO_DUPLICATE_ENTS = {}
NO_DUPLICATE_ENTS['ix_money'] = true
NO_DUPLICATE_ENTS['ix_item'] = true
NO_DUPLICATE_ENTS['ix_shipment'] = true
do
local TOOL_DANGEROUS = {}
TOOL_DANGEROUS["dynamite"] = true
TOOL_DANGEROUS["duplicator"] = true
function GAMEMODE:CanTool(client, trace, tool_name)
if (tool_name == "duplicator" and IsValid(trace.Entity) and (trace.Entity.NoDuplicate or NO_DUPLICATE_ENTS[trace.Entity:GetClass()])) then
return false
end
if (client:IsAdmin()) then
return true
end
if (TOOL_DANGEROUS[tool_name]) then
return false
end
return self.BaseClass:CanTool(client, trace, tool_name)
end
end