mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
44 lines
968 B
Lua
44 lines
968 B
Lua
|
|
--[[
|
||
|
|
| 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_LOADED then return end
|
||
|
|
|
||
|
|
local PLAYER = FindMetaTable("Player")
|
||
|
|
|
||
|
|
function PLAYER:GetUTime()
|
||
|
|
return self:sam_get_nwvar("TotalUTime")
|
||
|
|
end
|
||
|
|
|
||
|
|
function PLAYER:SetUTime(time)
|
||
|
|
self:sam_set_nwvar("TotalUTime", time)
|
||
|
|
end
|
||
|
|
|
||
|
|
function PLAYER:GetUTimeStart()
|
||
|
|
return self:sam_get_nwvar("UTimeStart")
|
||
|
|
end
|
||
|
|
|
||
|
|
function PLAYER:SetUTimeStart(time)
|
||
|
|
self:sam_set_nwvar("UTimeStart", time)
|
||
|
|
end
|
||
|
|
|
||
|
|
function PLAYER:GetUTimeSessionTime()
|
||
|
|
return CurTime() - self:GetUTimeStart()
|
||
|
|
end
|
||
|
|
|
||
|
|
function PLAYER:GetUTimeTotalTime()
|
||
|
|
return self:GetUTime() + CurTime() - self:GetUTimeStart()
|
||
|
|
end
|
||
|
|
|
||
|
|
if SERVER then
|
||
|
|
hook.Add("SAM.AuthedPlayer", "SAM.UTime", function(ply)
|
||
|
|
ply:SetUTime(ply:sam_get_play_time())
|
||
|
|
ply:SetUTimeStart(CurTime())
|
||
|
|
end)
|
||
|
|
end
|