mirror of
https://github.com/ZionDevelopers/sui-scoreboard.git
synced 2025-03-04 03:03:11 -05:00
Merge pull request #22 from ZionDevelopers/revert-19-utime_time_connected_fix2
Revert ""Time Connected" should display player's current session time from UTime" fixes #21
This commit is contained in:
commit
362890590b
@ -18,47 +18,47 @@ Version 2.6.3 - 2021-07-01 06:14 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:GetUTimeSessionTime())
|
||||
return math.floor((ply:GetUTime() + CurTime() - ply:GetUTimeStart()))
|
||||
elseif evolve ~= nil then
|
||||
return evolve:Time() - ply:GetNWInt( "EV_JoinTime" ) + ply:GetNWInt( "EV_PlayTime" )
|
||||
elseif maestro_promote then
|
||||
|
Loading…
Reference in New Issue
Block a user