lsft/modules/server/sv_serverinfo.txt

30 lines
1.2 KiB
Text
Raw Normal View History

--@name
--@author
--@server
do
local function getServerInfo()
-- Old, use core:log
print(core.colors.logo, "[L-SFT] ", core.colors.text, "-------------------------")
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Name: ", core.colors.text, game.getHostname())
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Players: ", core.colors.text, #find.allPlayers().."/"..game.getMaxPlayers())
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Map: ", core.colors.text, game.getMap())
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Tickrate: ", core.colors.text, math.round(1/game.getTickInterval()).." t/s")
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Is Dedicated: ", core.colors.text, game.isDedicated())
print(core.colors.logo, "[L-SFT] ", core.colors.text, "-------------------------")
end
core.modules.serverinfo = {
version = 1,
desc = "Provides basic server info.",
commands = {
serverinfo = {
usage = "serverinfo",
desc = "Prints basic server information to the chat.",
func = getServerInfo,
},
},
}
end