2022-04-27 03:03:28 +00:00
|
|
|
-- This should be added either as a autorun
|
|
|
|
-- or on your own outfit.
|
2022-06-22 10:14:47 +00:00
|
|
|
local away = false
|
|
|
|
|
2022-04-27 11:40:43 +00:00
|
|
|
hook.Add("AFK", "pac_afk", function(pl, afk)
|
|
|
|
if pl and pl == LocalPlayer() and afk then
|
|
|
|
LocalPlayer():ConCommand("pac_event afk 1")
|
|
|
|
else
|
|
|
|
LocalPlayer():ConCommand("pac_event afk 0")
|
2022-04-27 03:03:28 +00:00
|
|
|
end
|
|
|
|
end)
|
2022-04-27 11:40:43 +00:00
|
|
|
|
2022-06-22 10:14:47 +00:00
|
|
|
hook.Add("Think", "pac_away", function()
|
2022-04-27 11:40:43 +00:00
|
|
|
if not away and not system.HasFocus() then
|
|
|
|
away = true
|
|
|
|
LocalPlayer():ConCommand("pac_event away 1")
|
|
|
|
end
|
|
|
|
if away and system.HasFocus() then
|
|
|
|
away = false
|
|
|
|
LocalPlayer():ConCommand("pac_event away 0")
|
|
|
|
end
|
|
|
|
end)
|