<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/GetNetworkUsageData?action=history&amp;feed=atom</id>
	<title>GetNetworkUsageData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/GetNetworkUsageData?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetNetworkUsageData&amp;action=history"/>
	<updated>2026-05-09T19:03:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetNetworkUsageData&amp;diff=40550&amp;oldid=prev</id>
		<title>Miki785: Created page with &quot;__NOTOC__ {{Server client function}} This function returns a table containing network usage information about inbound and outbound packets.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; table...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetNetworkUsageData&amp;diff=40550&amp;oldid=prev"/>
		<updated>2014-07-05T21:22:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{Server client function}} This function returns a &lt;a href=&quot;/wiki/Table&quot; title=&quot;Table&quot;&gt;table&lt;/a&gt; containing network usage information about inbound and outbound packets.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; table...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns a [[table]] containing network usage information about inbound and outbound packets.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getNetworkUsageData ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] with two fields: &amp;quot;in&amp;quot; and &amp;quot;out&amp;quot;. Each of these contain a table with two fields: &amp;quot;bits&amp;quot; and &amp;quot;count&amp;quot;. Each of these contain a table with 256 numeric fields ranging from 0 to 255, containing the appropriate network usage data for such packet id.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds command ''nd'' that shows info about all inbound packets with bits bigger than zero.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;nd&amp;quot;,&lt;br /&gt;
	function ()&lt;br /&gt;
		local networkData = getNetworkUsageData()[&amp;quot;in&amp;quot;]&lt;br /&gt;
		for i, val in pairs(networkData[&amp;quot;count&amp;quot;]) do&lt;br /&gt;
			if networkData[&amp;quot;bits&amp;quot;][i] &amp;gt; 0 then&lt;br /&gt;
				outputChatBox(&amp;quot;ID: &amp;quot; .. i .. &amp;quot;: &amp;quot; .. val .. &amp;quot; - &amp;quot; .. networkData[&amp;quot;bits&amp;quot;][i] .. &amp;quot;b&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility_functions}}&lt;/div&gt;</summary>
		<author><name>Miki785</name></author>
	</entry>
</feed>