Fix: somevar typo

This commit is contained in:
Linventif 2024-11-21 22:50:52 +00:00
parent d7930c9194
commit 5c78fae9a6
2 changed files with 20 additions and 2 deletions

View File

@ -11,7 +11,7 @@ function gmInte.getPlayerFormat(ply)
["deaths"] = ply:Deaths(),
["customValues"] = ply:gmIntGetCustomValues(),
["connectTime"] = math.Round(math.Round(RealTime() - ply:gmIntGetConnectTime())),
["ajustTime"] = math.Round(ply:getAjustTime()),
["adjustedTime"] = math.Round(ply:getAdjustedTime()),
["ping"] = ply:Ping(),
["fps"] = ply:gmIntGetFPS(),
["position"] = gmInte.getVectorFormat(ply:GetPos()),

View File

@ -75,7 +75,7 @@ function ply:gmIntGetFPS()
end
gmInte.restoreFileCache = gmInte.restoreFileCache || {}
function ply:getAjustTime()
function ply:getAdjustedTime()
if SERVER then
if table.IsEmpty(gmInte.restoreFileCache) then
if file.Exists("gm_integration/player_before_map_change.json", "DATA") then
@ -101,6 +101,24 @@ function ply:getAjustTime()
return gmInte.restoreFileCache.playersList[self:SteamID()].connectTime || 0
end
if SERVER then
gameevent.Listen("player_connect")
hook.Add("player_connect", "gmInte:Player:Connect:RemoveRestore", function(data)
if table.IsEmpty(gmInte.restoreFileCache) then
if file.Exists("gm_integration/player_before_map_change.json", "DATA") then
gmInte.restoreFileCache = util.JSONToTable(file.Read("gm_integration/player_before_map_change.json", "DATA"))
else
return
end
end
if gmInte.restoreFileCache.playersList && gmInte.restoreFileCache.playersList[data.networkid] then
gmInte.restoreFileCache.playersList[data.networkid] = nil
file.Write("gm_integration/player_before_map_change.json", util.TableToJSON(gmInte.restoreFileCache, true))
end
end)
end
hook.Add("ShutDown", "gmInte:Server:ShutDown:SavePlayer", function()
local dataToSave = {
["version"] = "1.0",