fix: player is valid

This commit is contained in:
Linventif 2024-02-27 02:33:38 +01:00
parent 7a739564f1
commit 36e2de1883
No known key found for this signature in database
GPG Key ID: FAC0CA60F9AEEC24

View File

@ -46,14 +46,14 @@ function gmInte.refreshSettings()
end end
function gmInte.superadminGetConfig(ply) function gmInte.superadminGetConfig(ply)
if (!gmInte.plyValid(ply) || !ply:IsSuperAdmin()) then return end if (!ply:IsValid() || !ply:IsPlayer(ply) || !ply:IsSuperAdmin()) then return end
gmInte.config.websocket = GWSockets && true || false gmInte.config.websocket = GWSockets && true || false
gmInte.SendNet("adminConfig", gmInte.config, ply) gmInte.SendNet("adminConfig", gmInte.config, ply)
end end
function gmInte.publicGetConfig(ply) function gmInte.publicGetConfig(ply)
if (!gmInte.plyValid(ply)) then return end if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
gmInte.SendNet("publicConfig", { gmInte.SendNet("publicConfig", {
["debug"] = gmInte.config.debug, ["debug"] = gmInte.config.debug,
@ -62,7 +62,7 @@ function gmInte.publicGetConfig(ply)
end end
function gmInte.superadminSetConfig(ply, data) function gmInte.superadminSetConfig(ply, data)
if (!gmInte.plyValid(ply) || !ply:IsSuperAdmin()) then return end if (!ply:IsValid() || !ply:IsPlayer(ply) || !ply:IsSuperAdmin()) then return end
for k, v in pairs(data) do for k, v in pairs(data) do
gmInte.saveSetting(k, v) gmInte.saveSetting(k, v)