<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Game Timer]]></title><description><![CDATA[<p dir="auto">Timer that keeps track of total play time along with current round time and previous round time<br />
<img src="/assets/uploads/files/1777603431458-screenshot-2026-04-30-224255.png" alt="Screenshot 2026-04-30 224255.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Lines 26-28 allow you to change where its displayed</p>
<p dir="auto">#include maps\mp_utility;<br />
#include common_scripts\utility;<br />
#include maps\mp\gametypes_zm_hud_util;</p>
<p dir="auto">init()<br />
{<br />
level thread onPlayerConnect();<br />
}</p>
<p dir="auto">onPlayerConnect()<br />
{<br />
for(;;)<br />
{<br />
level waittill("connected", player);<br />
player thread playerGameTimers();<br />
}<br />
}</p>
<p dir="auto">playerGameTimers()<br />
{<br />
self endon("disconnect");<br />
level endon("end_game");</p>
<pre><code>flag_wait("initial_blackscreen_passed");

self.gameTimerHud = self createTimerHud("Game:", 400, 120);
self.roundTimerHud = self createTimerHud("Round:", 400, 145);
self.lastRoundTimerHud = self createTimerHud("Last:", 395, 170);

gameSeconds = 0;
roundSeconds = 0;
lastRoundSeconds = 0;
currentRound = getCurrentRound();

for(;;)
{
	newRound = getCurrentRound();

	if(newRound != currentRound)
	{
		lastRoundSeconds = roundSeconds;
		roundSeconds = 0;
		currentRound = newRound;
	}

	self.gameTimerHud setText("Game: " + formatTimer(gameSeconds));
	self.roundTimerHud setText("Round: " + formatTimer(roundSeconds));
	self.lastRoundTimerHud setText("Last: " + formatTimer(lastRoundSeconds));

	wait 1;

	gameSeconds++;
	roundSeconds++;
}
</code></pre>
<p dir="auto">}</p>
<p dir="auto">createTimerHud(label, x, y)<br />
{<br />
hud = createFontString("small", 1.35);<br />
hud setpoint("RIGHT", "TOP", x, y);<br />
hud.alpha = 1;<br />
hud.sort = 20;<br />
hud.color = (1, 1, 1);<br />
hud setText(label + " 00:00");<br />
return hud;<br />
}</p>
<p dir="auto">getCurrentRound()<br />
{<br />
if(isDefined(level.round_number))<br />
return level.round_number;</p>
<pre><code>if(isDefined(level.round))
	return level.round;

if(isDefined(level.zombie_round))
	return level.zombie_round;

return 1;
</code></pre>
<p dir="auto">}</p>
<p dir="auto">formatTimer(totalSeconds)<br />
{<br />
hours = 0;<br />
minutes = 0;<br />
seconds = totalSeconds;</p>
<pre><code>while(seconds &gt;= 3600)
{
	hours++;
	seconds -= 3600;
}

while(seconds &gt;= 60)
{
	minutes++;
	seconds -= 60;
}

if(hours &gt; 0)
	return hours + ":" + twoDigits(minutes) + ":" + twoDigits(seconds);

return minutes + ":" + twoDigits(seconds);
</code></pre>
<p dir="auto">}</p>
<p dir="auto">twoDigits(value)<br />
{<br />
if(value &lt; 10)<br />
return "0" + value;</p>
<pre><code>return "" + value;
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://forum.plutonium.pw/topic/44742/game-timer</link><generator>RSS for Node</generator><lastBuildDate>Sun, 03 May 2026 19:28:55 GMT</lastBuildDate><atom:link href="https://forum.plutonium.pw/topic/44742.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 01 May 2026 02:48:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Game Timer on Fri, 01 May 2026 18:06:21 GMT]]></title><description><![CDATA[<p dir="auto">Heres the links since i finally got a vote<br />
<a href="https://drive.google.com/file/d/1_F2WEZNLCL2GV6dguHE5enHGog8DpD9L/view?usp=sharing" target="_blank" rel="noopener noreferrer nofollow ugc">https://drive.google.com/file/d/1_F2WEZNLCL2GV6dguHE5enHGog8DpD9L/view?usp=sharing</a><br />
<a href="https://www.virustotal.com/gui/file/e9cec55c4eaeec1195436013149444ff3b7be96558a333c8c161535fd8045f46?nocache=1" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.virustotal.com/gui/file/e9cec55c4eaeec1195436013149444ff3b7be96558a333c8c161535fd8045f46?nocache=1</a></p>
]]></description><link>https://forum.plutonium.pw/post/171620</link><guid isPermaLink="true">https://forum.plutonium.pw/post/171620</guid><dc:creator><![CDATA[vnm_420]]></dc:creator><pubDate>Fri, 01 May 2026 18:06:21 GMT</pubDate></item></channel></rss>