Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lua/entities/gmod_wire_hologram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,16 @@ if CLIENT then
local function checkSteamid(steamid)
return string.match(steamid, "STEAM_%d+:%d+:%d+")
end

local blockfile = "wire_hologram_block.txt"

blocked = file.Exists(blockfile, "DATA")
and util.JSONToTable(file.Read(blockfile, "DATA")) or {}

local function saveBlocked()
file.Write(blockfile, util.TableToJSON(blocked))
end

concommand.Add("wire_holograms_block_client",
function(ply, command, args)
if not args[1] then print("Invalid steamid") return end
Expand All @@ -367,6 +377,8 @@ if CLIENT then
if not toblock then print("Invalid steamid") return end

blocked[toblock] = true
saveBlocked()

for _, ent in ipairs(ents.FindByClass("gmod_wire_hologram")) do
if ent.steamid == toblock then
ent.blocked = true
Expand All @@ -379,7 +391,7 @@ if CLIENT then
table.insert(help, cmd.." \""..ply:SteamID().."\" // "..ply:Name())
end
return help
end)
end)

concommand.Add("wire_holograms_unblock_client",
function(ply, command, args)
Expand All @@ -390,6 +402,7 @@ if CLIENT then
if not blocked[toblock] then print("This steamid isn't blocked") return end

blocked[toblock] = nil
saveBlocked()
for _, ent in ipairs(ents.FindByClass("gmod_wire_hologram")) do
if ent.steamid == toblock then
ent.blocked = false
Expand Down
Loading