mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
46
gamemodes/helix/plugins/checkstaff.lua
Normal file
46
gamemodes/helix/plugins/checkstaff.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
if (!sam) then return end
|
||||
|
||||
PLUGIN.name = "Check Staff"
|
||||
PLUGIN.author = "AleXXX_007"
|
||||
PLUGIN.description = "Allows superadmins to check various info about server staff."
|
||||
|
||||
ix.command.Add("CheckStaff", {
|
||||
description = "Get admins list with their last play time.",
|
||||
superAdminOnly = true,
|
||||
OnRun = function(self, client)
|
||||
local query = mysql:Select("sam_players")
|
||||
query:Select("steamid")
|
||||
query:Select("name")
|
||||
query:Select("rank")
|
||||
query:Select("last_join")
|
||||
query:Select("play_time")
|
||||
query:WhereNotLike("rank", "user")
|
||||
query:Callback(function(result)
|
||||
if (!result or !istable(result) or #result == 0) then
|
||||
client:NotifyLocalized("No staff found!")
|
||||
return
|
||||
end
|
||||
|
||||
for _, v in pairs(result) do
|
||||
local playTime = math.Round(v.play_time / 3600, 1)
|
||||
if (player.GetBySteamID(v.steamid)) then
|
||||
client:ChatPrint(v.name .. " (" .. v.steamid .. "), " .. v.rank .. " is currently online. Total play time: " .. playTime .. " hours.")
|
||||
else
|
||||
client:ChatPrint(v.name .. " (" .. v.steamid .. "), " .. v.rank .. " was online " .. os.date("%x %X", v.last_join) .. ". Total play time: " .. playTime .. " hours.")
|
||||
end
|
||||
end
|
||||
end)
|
||||
query:Execute()
|
||||
end
|
||||
})
|
||||
Reference in New Issue
Block a user