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 @@
local function checkSteamid(steamid)
return string.match(steamid, "STEAM_%d+:%d+:%d+")
end

Check warning on line 362 in lua/entities/gmod_wire_hologram.lua

View workflow job for this annotation

GitHub Actions / lint

"Trailing whitespace"

Trailing whitespace
local blockfile = "wire_hologram_block.txt"

Check warning on line 364 in lua/entities/gmod_wire_hologram.lua

View workflow job for this annotation

GitHub Actions / lint

"Trailing whitespace"

Trailing whitespace
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 not toblock then print("Invalid steamid") return end

blocked[toblock] = true
saveBlocked()

Check warning on line 381 in lua/entities/gmod_wire_hologram.lua

View workflow job for this annotation

GitHub Actions / lint

"Trailing whitespace"

Trailing whitespace
for _, ent in ipairs(ents.FindByClass("gmod_wire_hologram")) do
if ent.steamid == toblock then
ent.blocked = true
Expand All @@ -379,7 +391,7 @@
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 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