mirror of
https://github.com/JonnyBro/beatrun.git
synced 2025-04-05 18:36:33 +05:00
Uncomment replay code
This commit is contained in:
parent
65b36f81b0
commit
3531c2e769
3 changed files with 17 additions and 21 deletions
|
@ -44,7 +44,7 @@ function ENT:StartTouch(ent)
|
|||
ent:SetNW2Int("CPNum", ent:GetNW2Int("CPNum", 1) + 1)
|
||||
|
||||
if ent:GetNW2Int("CPNum", 1) > table.Count(Checkpoints) then
|
||||
-- ReplayStop(ent)
|
||||
ReplayStop(ent)
|
||||
FinishCourse(ent)
|
||||
else
|
||||
ent.CPSavePos = ent:GetPos()
|
||||
|
|
|
@ -211,8 +211,8 @@ function PLAYER:Spawn()
|
|||
ply:SetPos(Course_StartPos)
|
||||
end)
|
||||
|
||||
-- ReplayStop(ply)
|
||||
-- ReplayStart(ply)
|
||||
ReplayStop(ply)
|
||||
ReplayStart(ply)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ if CLIENT then
|
|||
|
||||
LocalPlayer():EmitSound("A_TT_Finish_Positive.wav")
|
||||
SaveCheckpointTime()
|
||||
-- SaveReplayData()
|
||||
SaveReplayData()
|
||||
else
|
||||
timetext = "+" .. string.FormattedTime(math.abs(timestr), "%02i:%02i:%02i")
|
||||
timecolor = color_negative
|
||||
|
@ -308,23 +308,19 @@ function LoadCheckpointTime()
|
|||
return times or nil
|
||||
end
|
||||
|
||||
-- function SaveReplayData()
|
||||
-- local replay = util.Compress(util.TableToJSON(LocalPlayer().ReplayTicks))
|
||||
-- local dir = "beatrun/replays/" .. game.GetMap() .. "/"
|
||||
|
||||
-- if not replay then return end
|
||||
|
||||
-- file.CreateDir(dir)
|
||||
-- file.Write(dir .. Course_ID .. ".txt", replay)
|
||||
-- end
|
||||
|
||||
-- function LoadReplayData()
|
||||
-- local dir = "beatrun/replays/" .. game.GetMap() .. "/"
|
||||
-- local replay = file.Read(dir .. Course_ID .. ".txt")
|
||||
-- replay = replay and util.JSONToTable(util.Decompress(replay))
|
||||
|
||||
-- return replay or nil
|
||||
-- end
|
||||
function SaveReplayData()
|
||||
local replay = util.Compress(util.TableToJSON(LocalPlayer().ReplayTicks))
|
||||
local dir = "beatrun/replays/" .. game.GetMap() .. "/"
|
||||
if not replay then return end
|
||||
file.CreateDir(dir)
|
||||
file.Write(dir .. Course_ID .. ".txt", replay)
|
||||
end
|
||||
function LoadReplayData()
|
||||
local dir = "beatrun/replays/" .. game.GetMap() .. "/"
|
||||
local replay = file.Read(dir .. Course_ID .. ".txt")
|
||||
replay = replay and util.JSONToTable(util.Decompress(replay))
|
||||
return replay or nil
|
||||
end
|
||||
|
||||
function StartCourse(spawntime)
|
||||
local faststartmult = LocalPlayer():GetInfoNum("Beatrun_FastStart", 0) > 0 and 0.5 or 1
|
||||
|
|
Loading…
Add table
Reference in a new issue