-- Forward displayplayer (splitscreen) offset to player_t. -- Written by James R. This file is placed in the public domain. local firstplayer = #players local lastplayer = 0 rawset (_G, "splitscreens", {}) addHook("NetVars", function (fn) splitscreens = fn(splitscreens) end) hud.add(function (v, p) if (#p < firstplayer) then firstplayer = #p end if (#p > lastplayer) then lastplayer = #p end if (lastplayer - firstplayer == splitscreen) -- the last player just set then local n = 0 for i = firstplayer, lastplayer do splitscreens[i] = n n = $+1 end firstplayer = #players lastplayer = 0 end end) COM_AddCommand("whos", function (consoleplayer) for p in players.iterate do CONS_Printf(consoleplayer, string.format("%d %s", splitscreens[#p], p.name)) end end)