<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ZoLo</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ZoLo"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/ZoLo"/>
	<updated>2026-05-04T01:18:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BitReplace&amp;diff=37253</id>
		<title>BitReplace</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BitReplace&amp;diff=37253"/>
		<updated>2013-10-02T22:30:35Z</updated>

		<summary type="html">&lt;p&gt;ZoLo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.0132|1.3.2|5340|&lt;br /&gt;
This function returns the unsigned number formed by var value with replacement specified at bits field to field + width - 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
uint bitReplace ( uint var, uint replaceValue, int field, int width = 1 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''var:''' The value&lt;br /&gt;
*'''replaceValue:''' The replaceValue&lt;br /&gt;
*'''field:''' The field number&lt;br /&gt;
*'''width:''' Number of bits to extract&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the replaced value/bit sequence.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function replaceColorAlpha(color, alpha)&lt;br /&gt;
   return bitReplace(color,alpha,24,8) -- return value with replaced bits 24-32 ( the alpha, http://en.wikipedia.org/wiki/RGBA_color_space ) &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Bit_functions}}&lt;/div&gt;</summary>
		<author><name>ZoLo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BitReplace&amp;diff=37252</id>
		<title>BitReplace</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BitReplace&amp;diff=37252"/>
		<updated>2013-10-02T22:20:41Z</updated>

		<summary type="html">&lt;p&gt;ZoLo: Created page with &amp;quot;{{Server client function}} {{Needs_Example}} __NOTOC__ {{New feature/item|3.0132|1.3.2|5340| ... }}  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; uint bitReplace ( uint var, uint replaceValue, int f...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.0132|1.3.2|5340|&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
uint bitReplace ( uint var, uint replaceValue, int field, int width = 1 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''var:''' The value&lt;br /&gt;
*'''replaceValue:''' The replaceValue&lt;br /&gt;
*'''field:''' The field number&lt;br /&gt;
*'''width:''' Number of bits to extract&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the replaced value/bit sequence.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function replaceColorAlpha(color, alpha)&lt;br /&gt;
   return bitReplace(color,alpha,24,8) -- return value with replaced bits 24-32 ( the alpha, http://en.wikipedia.org/wiki/RGBA_color_space ) &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Bit_functions}}&lt;/div&gt;</summary>
		<author><name>ZoLo</name></author>
	</entry>
</feed>