mirror of
https://github.com/Earu/EasyChat.git
synced 2025-03-04 03:13:20 -05:00
check if a command is blocked for the command mode + rare error fix
This commit is contained in:
parent
9e2cd7ef5a
commit
b9b38eb59b
@ -1774,6 +1774,16 @@ if CLIENT then
|
||||
end)
|
||||
|
||||
EasyChat.AddMode("Console", function(text)
|
||||
if IsConCommandBlocked(text) then
|
||||
local text_entry = EasyChat.GetMainTextEntry()
|
||||
if IsValid(text_entry) then
|
||||
local command = text:Split(" ")[1]
|
||||
text_entry:TriggerBlink(("'%s' IS BLOCKED! USE THE CONSOLE!"):format(command))
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
LocalPlayer():ConCommand(text)
|
||||
end)
|
||||
|
||||
@ -2804,6 +2814,12 @@ if CLIENT then
|
||||
|
||||
local chathud = EasyChat.ChatHUD
|
||||
local function chathud_screen_resolution_changed()
|
||||
if not chathud then
|
||||
chathud = EasyChat.ChatHUD
|
||||
end
|
||||
|
||||
if not chathud then return end
|
||||
|
||||
local x, y, w, h = EasyChat.GetDefaultBounds()
|
||||
x, y, w, h = chathud_get_bounds(x, y, w, h)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user