Lua loaded records #9
@ -492,5 +492,6 @@ local function netvars(net)
|
|||||||
prefMode = net($)
|
prefMode = net($)
|
||||||
scrollPos = net($)
|
scrollPos = net($)
|
||||||
MapRecords = net($)
|
MapRecords = net($)
|
||||||
|
ModeSep = net($)
|
||||||
end
|
end
|
||||||
addHook("NetVars", netvars)
|
addHook("NetVars", netvars)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
-- Holds the current maps records table including all modes
|
-- Holds the current maps records table including all modes
|
||||||
local MapRecords = {}
|
local MapRecords = {}
|
||||||
|
|
||||||
local timeFinished = 0
|
local TimeFinished = 0
|
||||||
local disable = false
|
local disable = false
|
||||||
local prevLap = 0
|
local prevLap = 0
|
||||||
local splits = {}
|
local splits = {}
|
||||||
@ -699,7 +699,7 @@ COM_AddCommand("rival", findRival)
|
|||||||
--end
|
--end
|
||||||
|
|
||||||
addHook("MapLoad", function()
|
addHook("MapLoad", function()
|
||||||
timeFinished = 0
|
TimeFinished = 0
|
||||||
splits = {}
|
splits = {}
|
||||||
prevLap = 0
|
prevLap = 0
|
||||||
drawState = DS_DEFAULT
|
drawState = DS_DEFAULT
|
||||||
@ -1142,7 +1142,7 @@ local function saveTime(player)
|
|||||||
player.name,
|
player.name,
|
||||||
player.mo.skin,
|
player.mo.skin,
|
||||||
player.skincolor,
|
player.skincolor,
|
||||||
timeFinished,
|
TimeFinished,
|
||||||
splits,
|
splits,
|
||||||
Flags,
|
Flags,
|
||||||
stat_t(player.HMRs or pskin.kartspeed, player.HMRw or pskin.kartweight)
|
stat_t(player.HMRs or pskin.kartspeed, player.HMRw or pskin.kartweight)
|
||||||
@ -1185,14 +1185,14 @@ end
|
|||||||
|
|
||||||
-- DEBUGGING
|
-- DEBUGGING
|
||||||
--local function saveLeaderboard(player, ...)
|
--local function saveLeaderboard(player, ...)
|
||||||
-- timeFinished = tonumber(... or player.realtime)
|
-- TimeFinished = tonumber(... or player.realtime)
|
||||||
-- splits = {1000, 2000, 3000}
|
-- splits = {1000, 2000, 3000}
|
||||||
-- saveTime(player)
|
-- saveTime(player)
|
||||||
--end
|
--end
|
||||||
--COM_AddCommand("save", saveLeaderboard)
|
--COM_AddCommand("save", saveLeaderboard)
|
||||||
|
|
||||||
local function regLap(player)
|
local function regLap(player)
|
||||||
if player.laps > prevLap and timeFinished == 0 then
|
if player.laps > prevLap and TimeFinished == 0 then
|
||||||
prevLap = player.laps
|
prevLap = player.laps
|
||||||
table.insert(splits, player.realtime)
|
table.insert(splits, player.realtime)
|
||||||
showSplit = 5 * TICRATE
|
showSplit = 5 * TICRATE
|
||||||
@ -1307,8 +1307,8 @@ local function think()
|
|||||||
|
|
||||||
if p then
|
if p then
|
||||||
-- must be done before browser control
|
-- must be done before browser control
|
||||||
if p.laps >= mapheaderinfo[gamemap].numlaps and timeFinished == 0 then
|
if p.laps >= mapheaderinfo[gamemap].numlaps and TimeFinished == 0 then
|
||||||
timeFinished = p.realtime
|
TimeFinished = p.realtime
|
||||||
saveTime(p)
|
saveTime(p)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1401,5 +1401,6 @@ local function netvars(net)
|
|||||||
StatTrack = net($)
|
StatTrack = net($)
|
||||||
EncoreInitial = net($)
|
EncoreInitial = net($)
|
||||||
MapRecords = net($)
|
MapRecords = net($)
|
||||||
|
TimeFinished = net($)
|
||||||
end
|
end
|
||||||
addHook("NetVars", netvars)
|
addHook("NetVars", netvars)
|
||||||
|
Loading…
Reference in New Issue
Block a user