mirror of
https://github.com/sr229/metastruct-experiments.git
synced 2024-09-20 06:30:36 +00:00
e7503545df
Signed-off-by: Ayane Satomi <ayane@vignetteapp.org>
22 lines
No EOL
603 B
Text
22 lines
No EOL
603 B
Text
-- This should be added either as a autorun
|
|
-- or on your own outfit.
|
|
local away = false
|
|
|
|
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")
|
|
end
|
|
end)
|
|
|
|
hook.Add("Think", "pac_away", function()
|
|
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) |