Garry's Mod

Garry's Mod

50 个评价
Simple AFK System
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
插件标签: 建筑, 角色扮演
文件大小
发表于
更新日期
3.814 KB
2017 年 3 月 16 日 下午 2:19
2018 年 10 月 25 日 下午 5:23
5 项改动说明 ( 查看 )

订阅以下载
Simple AFK System

描述
Version: 222

A feature rich AFK system for any gamemode in Garry's Mod.

Type !afk in chat to toggle AFK mode!

Features:
- Allows you to provide a reason.
- Stops other players from interacting with you.
- Blocks the player from doing anything when there AFK.
- Informs other players that your AFK.
- Remembers your weapons.
- Remembers your active weapon.
- Remembers your ammo.
- Change AFK reason while your AFK.
- Admins can set 'AFK Locations' where the player will be teleported to.

Hooks/Functions developers:
-- All hooks are in both server and client realms. -- afkSystemPlayerEnter is called when the player becomes AFK. hook.Add("afkSystemPlayerEnter", "playerIsNowAFK", function(ply, reason) print(ply:Nick() .. " is now AFK because " .. reason) end) -- afkSystemPlayerUpdate is called when the player updates their reason. hook.Add("afkSystemPlayerUpdate", "playerUpdateReason", function(ply, reason) print(ply:Nick() .. " updated their AFK reason to " .. reason) end) -- afkSystemPlayerLeave is called when the player returns to the game. hook.Add("afkSystemPlayerLeave", "playerIsNowAFK", function(ply) print(ply:Nick() .. " has returned to the game.") end) -- All functions are in both server and client realms. -- 'PLAYER' in this case is a player object. PLAYER:isAFK() -- Is the player AFK? Returns a boolean either true or false. PLAYER:afkReason() -- Reason for AFK. Returns a string. PLAYER:afkTime() -- Time they started being AFK. Returns a timestamp integer. (`os.time()`)

Donate[viral32111.com]

GitHub Version[github.com]

Copyright 2017-2021 viral32111[github.com]
热门讨论 查看全部(1)
5
2021 年 10 月 17 日 下午 2:12
置顶: Todo List
viral32111
34 条留言
@ your service 2 月 12 日 上午 1:09 
Would be cool if the player became a CPU bot while AFK like in Left 4 Dead 1 & 2.
RobPlayzPL 2020 年 11 月 15 日 上午 2:56 
the error message on the console says this:

[Simple AFK System] lua/autorun/server/sv_command.lua:144: attempt to concatenate a nil value
1. v - lua/autorun/server/sv_command.lua:144
2. unknown - lua/includes/modules/hook.lua:84
viral32111  [作者] 2020 年 11 月 15 日 上午 1:48 
What's the error message? There should be one printed in the console.
RobPlayzPL 2020 年 11 月 14 日 上午 4:53 
how do i actually activate it cause when i type in !afk on chat on the top left it keeps saying "Simple AFK System" is creating an error
viral32111  [作者] 2020 年 3 月 15 日 上午 3:24 
I'll add it to my to do list and get around to it when I can, but I don't really work on this addon much anymore. Sorry.
ペクスイー シュ『Pekusuii | Shu』 2020 年 3 月 12 日 上午 4:35 
Can you add a function when players get AFK they kill themselves and after back to the game spawn again?
viral32111  [作者] 2018 年 11 月 29 日 上午 6:00 
It's a table called "afkPositions" inside lua/autorun/server/sv_command.lua
Zeity 2018 年 11 月 28 日 下午 8:28 
I am currently using this for my server but i am wondering how to set locations for being afk?
MysteriousGirl 2018 年 10 月 25 日 下午 11:43 
Cool! Can't wait for the next update! Once those features are added I will definitely be adding this to the server. The auto afk and the hovering text especially.
viral32111  [作者] 2018 年 10 月 25 日 下午 5:27 
Update 222

Big overhaul, basically rewrote the entire addon and heavily optimized it.

For a detailed changelog see the GitHub Commit: https://github.com/viral32111/simple-afk-system/commit/30ef1171443a1b0f1caf0d593f5af5cd1519c922

In the next updates i'll probably add the following:
- Automatic AFK or auto kick/spectate when the player doesn't move for an extended period of time. (Haley and Brad's/TestBot's request)
- Overhead text above AFK players.
- "I'll be AFK in..."-like system where you can specify when you'll be AFK, then it will auto-afk you after that time has elapsed. (This is a maybe though, still thinking about it.)