mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
Feat: add timeLastTeamChange
This commit is contained in:
parent
94ebf5cba6
commit
9e9a2dfe01
|
@ -11,6 +11,7 @@ function gmInte.getPlayerFormat(ply)
|
||||||
["deaths"] = ply:Deaths(),
|
["deaths"] = ply:Deaths(),
|
||||||
["customValues"] = ply:gmIntGetCustomValues(),
|
["customValues"] = ply:gmIntGetCustomValues(),
|
||||||
["connectTime"] = math.Round(math.Round(RealTime() - ply:gmIntGetConnectTime())),
|
["connectTime"] = math.Round(math.Round(RealTime() - ply:gmIntGetConnectTime())),
|
||||||
|
["timeLastTeamChange"] = math.Round(RealTime() - ply:gmIntGetTimeLastTeamChange()),
|
||||||
["adjustedTime"] = math.Round(ply:getAdjustedTime()),
|
["adjustedTime"] = math.Round(ply:getAdjustedTime()),
|
||||||
["ping"] = ply:Ping(),
|
["ping"] = ply:Ping(),
|
||||||
["fps"] = ply:gmIntGetFPS(),
|
["fps"] = ply:gmIntGetFPS(),
|
||||||
|
|
|
@ -7,6 +7,10 @@ function ply:gmIntIsVerified()
|
||||||
return self.gmIntVerified || false
|
return self.gmIntVerified || false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ply:gmIntGetTimeLastTeamChange()
|
||||||
|
return self.gmIntTimeLastTeamChange || RealTime()
|
||||||
|
end
|
||||||
|
|
||||||
function ply:gmInteGetBranch()
|
function ply:gmInteGetBranch()
|
||||||
return CLIENT && BRANCH || self.branch || "unknown"
|
return CLIENT && BRANCH || self.branch || "unknown"
|
||||||
end
|
end
|
||||||
|
@ -144,3 +148,6 @@ hook.Add("ShutDown", "gmInte:Server:ShutDown:SavePlayer", function()
|
||||||
file.Write("gmod_integration/player_before_map_change.json", util.TableToJSON(oldData, true))
|
file.Write("gmod_integration/player_before_map_change.json", util.TableToJSON(oldData, true))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
// on team change reset the time
|
||||||
|
hook.Add("PlayerChangedTeam", "gmInte:Player:ChangedTeam:ResetTime", function(ply) ply.gmIntTimeLastTeamChange = RealTime() end)
|
Loading…
Reference in New Issue
Block a user