<?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[[Release] AFK Monitor]]></title><description><![CDATA[<h1>AFK Monitor</h1>
<p dir="auto">Developed by <strong>DoktorSAS</strong></p>
<h3>Black ops II Zombies Version</h3>
<h2>How to use it?</h2>
<ol>
<li>Add to your init <strong>level thread endgame_fix();</strong></li>
</ol>
<pre><code>init(){
       level thread onPlayerConnect();
       level thread endgame_fix();
}
</code></pre>
<ol start="2">
<li>Add on your onPlayerConnect <strong>player thread player_is_afk();</strong></li>
</ol>
<pre><code>onPlayerConnect(){
    for(;;){
        level waittill("connected", player);
        player thread onPlayerSpawned();
        player thread player_is_afk();
    }
}
</code></pre>
<ol start="3">
<li>Add yo your code this <strong>functions</strong></li>
</ol>
<pre><code>player_is_afk(){ // Made by DoktorSAS
	self endon("disconnect");
    level endon("end_game");
	old_origin = self.origin;
	old_angles = self getPlayerAngles();
	seconds_to_be_afk = 5; // Change this value to change wait time to be afk
	counter = 0;
	wait 5; // Wait time to turn on AFK Script
	for(;;){
		old_origin = self.origin;
		old_angles = self getPlayerAngles();
		wait 1;
		if(distance(old_origin, self.origin) &lt;= 5 &amp;&amp; old_angles == self getPlayerAngles() &amp;&amp; counter &lt; seconds_to_be_afk){
			counter++;
		}else if(counter == seconds_to_be_afk){
			self thread maps/mp/gametypes_zm/_spectating::setspectatepermissions();
    		self.sessionstate = "spectator";
    		self thread print_to_all( self.name + " is ^1AFK^7, now the player is on Spectator");
    		old_origin = self.origin;
    		old_angles = self getPlayerAngles();
    		while(distance(old_origin, self.origin) &lt;= 5 || old_angles != self getPlayerAngles()){
    			old_angles = self getPlayerAngles();
    			wait 0.05;
    		}
    		self.sessionstate = "playing";
    		counter = 0;
		}else if(counter &gt; seconds_to_be_afk)
			counter = 0;
	}
}
endgame_fix(){
	self endon("disconnect");
    level endon("end_game");
    level waittill("connected", player);
    for(;;){
    	wait 1;
    	counter = 0;
    	foreach(player in level.players){
    		if(player.sessionstate == "spectator" || !isAlive(player))
    			counter++;
    	}
    	if(counter == level.players.size)
    		level notify("end_game");
    }
}
print_to_all( msg ){
	foreach( player in level.players)
		player iprintln( msg );
}

</code></pre>
<h3>How to change time to be AFK?</h3>
<p dir="auto">On the code there a variable called <strong>seconds_to_be_afk</strong> just chaneg the value of this variable to change the time to put afk status a player</p>
<h4>Multiplayer</h4>
<pre><code>Cooming soon
</code></pre>
]]></description><link>https://forum.plutonium.pw/topic/4333/release-afk-monitor</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 10:35:31 GMT</lastBuildDate><atom:link href="https://forum.plutonium.pw/topic/4333.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Sep 2020 12:53:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Release] AFK Monitor on Sun, 28 Nov 2021 20:25:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sorex" aria-label="Profile: Sorex"><bdi>Sorex</bdi></a></p>
<p dir="auto">As far as recognizing if someone is afk and putting him into spectator works flawless</p>
<p dir="auto">But the player does not join in when any input is given tho. And if the round ends and the afk player will be respawned he spawns without his old equipment</p>
]]></description><link>https://forum.plutonium.pw/post/64097</link><guid isPermaLink="true">https://forum.plutonium.pw/post/64097</guid><dc:creator><![CDATA[THS.Shiniri]]></dc:creator><pubDate>Sun, 28 Nov 2021 20:25:07 GMT</pubDate></item></channel></rss>