Lockdown: Plan your server's opening and closing times!
trt_lockdown The resource allows you to manage server access based on specified time intervals. During the lockdown period, players who are not whitelisted will be unable to connect to the server. This is useful for maintaining control over player access during specific hours. Could also be...
forum.cfx.re
该资源允许您根据指定的时间间隔管理服务器访问。在封锁期间,未列入白名单的玩家将无法连接到服务器。这对于在特定时间内控制玩家访问非常有用。
还可以用于管理半白名单服务器,这些服务器希望允许某些玩家在特定时间段内使用不和谐角色列表进行连接。
特征
- 在指定时间自动关闭服务器。
- 允许白名单玩家在封锁期间连接。
依赖
ox_lib (用于 cron 作业调度)配置
锁定配置可以在以下config/server文件中找到:
lua:
return {
versionCheck = true,
lockdown = {
enabled = true,
-- true: Kick all players during lockdown, false: Keep whitelisted players
kickAllPlayers = true,
from = { -- Time when the server closes (24-hour format)
hour = 3,
minute = 15
},
to = { -- Time when the server opens (24-hour format)
hour = 17,
minute = 30,
}
},
-- List of whitelisted player identifiers has to follow the following templates.
allowedIdentifiers = {
-- 'license:a84c129fbad317b8d5f6c7e18f0248abc9d5e13f' -- Example license identifier
-- 'discord:294990611633799180' -- Example discord identifier
},
-- Optional Discord role check for semi-whitelist servers (thanks @Maximus7474!)
discord = {
-- Discord Bot Token: https://discord.com/developers/applications
-- Set to false to disable the Discord role check feature
token = false,
-- Guild Identifier
guildId = '',
-- List of allowed role identifiers
allowedRoles = {
-- '892853647950618675' -- Example role identifier
}
}
}
权限
为了允许某些玩家绕过封锁,您可以在服务器配置中设置以下权限:
代码:
add_ace identifier.discord:xxx lockdown.bypass allow
add_ace group.mod lockdown.bypass allow
将 identifier.discord:xxx 替换为适合玩家的 Discord 标识符。
安装
- 下载 trt_lockdown 脚本。
- 将其放在您的服务器的资源目录中。
- 将启动 trt_lockdown 添加到您的 server.cfg。
- 根据需要配置 config.server 文件。
用法
配置完成后,脚本将根据配置中指定的时间自动管理服务器访问。在封锁期间尝试连接的玩家将收到拒绝消息,除非他们被列入白名单。源代码
GitHub - t0r3tto/trt_lockdown
Contribute to t0r3tto/trt_lockdown development by creating an account on GitHub.
github.com