1
0
mirror of https://github.com/Earu/EasyChat.git synced 2025-03-04 03:13:20 -05:00

fix an issue with version checking

This commit is contained in:
Earu 2021-08-10 14:44:15 +02:00
parent 1b1007d7bc
commit 6bfd2bec53

View File

@ -553,9 +553,9 @@ if SERVER then
hook.Remove("Think", TAG)
end)
local has_version_warned = false
hook.Add("ECOpened", TAG, function(ply)
if has_version_warned then return end
if not ply:IsAdmin() then return end
if ply.ECHasVersionWarned then return end
if is_outdated and EC_VERSION_WARNING:GetBool() then
local msg_components = { COLOR_GRAY, "The server is running an", COLOR_RED, " outdated ", COLOR_GRAY, "version of", COLOR_RED, " EasyChat" }
@ -571,7 +571,7 @@ if SERVER then
ply:SendLua([[cookie.Delete("ECChromiumWarn")]])
end
has_version_warned = true
ply.ECHasVersionWarned = true
end)
hook.Add("PlayerCanSeePlayersChat", TAG, EasyChat.PlayerCanSeePlayersChat)