"Time Connected" should display player's current session time

This commit is contained in:
UAVXP 2020-03-19 01:13:31 +02:00
parent 1a6c8d3117
commit b9cc6d3980

View File

@ -18,47 +18,47 @@ Version 2.6.2 - 12-06-2014 05:33 PM(UTC -03:00)
-- Kick player
Scoreboard.kick = function (ply)
if ply:IsValid() then
if ply:IsValid() then
if exsto ~= nil then
LocalPlayer():ConCommand( "exsto kick \"".. ply:Nick().. "\" \"Kicked By Administrator\"" )
LocalPlayer():ConCommand( "exsto kick \"".. ply:Nick().. "\" \"Kicked By Administrator\"" )
elseif ulx ~= nil then
LocalPlayer():ConCommand( "ulx kick \"".. ply:Nick().. "\" \"Kicked By Administrator\"" )
elseif evolve ~= nil then
LocalPlayer():ConCommand( "ev kick \"".. ply:Nick().. "\" \"Kicked By Administrator\"" )
LocalPlayer():ConCommand( "ev kick \"".. ply:Nick().. "\" \"Kicked By Administrator\"" )
elseif maestro ~= nil then
LocalPlayer():ConCommand( "ms kick \"$" .. ply:SteamID() .. "\" \"Kicked By Administrator\"" )
elseif Mercury~=nil then
elseif Mercury~=nil then
LocalPlayer():ConCommand( "hg kick \"" .. ply:SteamID() .. "\" \"Kicked By Administrator\"" )
end
end
end
-- Permanent ban player
Scoreboard.pBan = function(ply)
if ply:IsValid() then
Scoreboard.pBan = function(ply)
if ply:IsValid() then
if exsto ~= nil then
LocalPlayer():ConCommand( "exsto ban \"".. ply:Nick().. "\" 0 \" Banned permanently by Administrator\"" )
elseif ulx ~= nil then
LocalPlayer():ConCommand( "ulx ban \"".. ply:Nick().. "\" 0 \" Banned permanently by Administrator\"" )
LocalPlayer():ConCommand( "ulx ban \"".. ply:Nick().. "\" 0 \" Banned permanently by Administrator\"" )
elseif evolve ~= nil then
LocalPlayer():ConCommand( "ev ban \"".. ply:Nick().. "\" 0 \"Kicked By Administrator\"" )
LocalPlayer():ConCommand( "ev ban \"".. ply:Nick().. "\" 0 \"Kicked By Administrator\"" )
elseif maestro ~= nil then
LocalPlayer():ConCommand( "ms ban \"$" .. ply:SteamID() .. "\" 0 \"Banned permanently by Administrator\"" )
elseif Mercury~=nil then
elseif Mercury~=nil then
LocalPlayer():ConCommand( "hg ban \"" .. ply:SteamID() .. "\" 0 \"Quick ban via scoreboard\"" )
end
end
end
-- Ban player
Scoreboard.ban = function(ply)
Scoreboard.ban = function(ply)
if ply:IsValid() then
if exsto ~= nil then
LocalPlayer():ConCommand( "exsto ban \"".. ply:Nick().. "\" 60 \" Banned for 1 hour by Administrator\"" )
elseif ulx ~= nil then
LocalPlayer():ConCommand( "ulx ban \"".. ply:Nick().. "\" 60 \" Banned for 1 hour by Administrator\"" )
LocalPlayer():ConCommand( "ulx ban \"".. ply:Nick().. "\" 60 \" Banned for 1 hour by Administrator\"" )
elseif evolve ~= nil then
LocalPlayer():ConCommand( "ev ban \"".. ply:Nick().. "\" 60 \"Kicked By Administrator\"" )
LocalPlayer():ConCommand( "ev ban \"".. ply:Nick().. "\" 60 \"Kicked By Administrator\"" )
elseif maestro ~= nil then
LocalPlayer():ConCommand( "ms ban \"$" .. ply:SteamID() .. "\" 1h \"Banned permanently by Administrator\"" )
end
@ -89,14 +89,14 @@ Scoreboard.getGroup = function (ply)
return maestro.userrank(ply)
elseif Mercury ~= nil then
return team.GetName(ply:Team())
end
end
end
-- Create Scoreboard VGUI
Scoreboard.CreateVGUI = function()
if Scoreboard.vgui then
if Scoreboard.vgui then
Scoreboard.vgui:Remove()
Scoreboard.vgui = nil
Scoreboard.vgui = nil
end
Scoreboard.vgui = vgui.Create( "suiscoreboard" )
@ -143,16 +143,16 @@ Scoreboard.formatTime = function (time)
local w = math.floor(ttime / 7)
local str = ""
str = (w>0 and w.."w " or "")..(d>0 and d.."d " or "")
return string.format( str.."%02ih %02im %02is", h, m, s )
end
end
-- Get player's Played time
Scoreboard.getPlayerTime = function (ply)
-- Check if ULX and uTime is Installed
if ulx ~= nil and ply:GetNWInt( "TotalUTime", -1 ) ~= -1 then
-- Get player's played time
return math.floor((ply:GetUTime() + CurTime() - ply:GetUTimeStart()))
return math.floor(ply:GetUTimeSessionTime())
elseif evolve ~= nil then
return evolve:Time() - ply:GetNWInt( "EV_JoinTime" ) + ply:GetNWInt( "EV_PlayTime" )
elseif maestro_promote then