Skip to content

Commit

Permalink
Fix concmd ply no longer valid entity if console
Browse files Browse the repository at this point in the history
  • Loading branch information
Seef0x authored and FPtje committed Dec 29, 2024
1 parent 251b843 commit 083b6ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gamemode/modules/fadmin/fadmin/adminchat/sv_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local function ToAdmins(ply, cmd, args)
local text = table.concat(args, " ")
local send = {}

if ply ~= game.GetWorld() then table.insert(send, ply) end
if IsValid(ply) then table.insert(send, ply) end
for _, v in ipairs(player.GetAll()) do
if FAdmin.Access.PlayerHasPrivilege(v, "AdminChat") or v:IsAdmin() then
table.insert(send, v)
Expand Down
2 changes: 1 addition & 1 deletion gamemode/modules/fadmin/fadmin/motd/sv_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function FAdmin.MOTD.SetMOTDPage(ply, cmd, args)
end

local function CreateMOTD(ply)
if ply ~= game.GetWorld() and not ply:IsSuperAdmin() then FAdmin.Messages.SendMessage(ply, 5, "No access!") return false end
if IsValid(ply) and not ply:IsSuperAdmin() then FAdmin.Messages.SendMessage(ply, 5, "No access!") return false end
local MOTDEnt = ents.Create("fadmin_motd")
MOTDEnt:SpawnFunction(ply, ply:GetEyeTrace())

Expand Down

0 comments on commit 083b6ef

Please sign in to comment.