<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/User:Erorr404/Editor/pseudocode?action=history&amp;feed=atom</id>
	<title>User:Erorr404/Editor/pseudocode - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/User:Erorr404/Editor/pseudocode?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Erorr404/Editor/pseudocode&amp;action=history"/>
	<updated>2026-04-08T00:16:11Z</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=User:Erorr404/Editor/pseudocode&amp;diff=7481&amp;oldid=prev</id>
		<title>Erorr404 at 23:50, 10 March 2007</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Erorr404/Editor/pseudocode&amp;diff=7481&amp;oldid=prev"/>
		<updated>2007-03-10T23:50:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;CLIENT:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
// NEEDED CLIENT FUNCTIONS:&lt;br /&gt;
// setFreeCam(bool on)&lt;br /&gt;
// mountElementToCam(element theElem, float distance)&lt;br /&gt;
// unMountElementToCam()&lt;br /&gt;
// moveElement(element theElem, float x, float y, float z, int milliseconds)&lt;br /&gt;
// stopElementMoving(element theElem)&lt;br /&gt;
// rotateElement(element theElem, float rx, float ry, float rz, int milliseconds)&lt;br /&gt;
&lt;br /&gt;
local selectedElement = nil&lt;br /&gt;
&lt;br /&gt;
function onClientResourceLoad&lt;br /&gt;
	setFreeCam(true)&lt;br /&gt;
	bindKeys()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindKeys()&lt;br /&gt;
	// bind selection keys&lt;br /&gt;
	bindKey(&amp;quot;mouse1&amp;quot;, &amp;quot;onPlayerLeftClick&amp;quot;)&lt;br /&gt;
	bindKey(&amp;quot;mouse2&amp;quot;, &amp;quot;onPlayerRightClick&amp;quot;)&lt;br /&gt;
	// bind movement keys&lt;br /&gt;
	bindKey(&amp;quot;up&amp;quot;, &amp;quot;moveElementUp&amp;quot;)&lt;br /&gt;
	bindKey(&amp;quot;down&amp;quot;, &amp;quot;moveElementDown&amp;quot;)&lt;br /&gt;
	bindKey(&amp;quot;left&amp;quot;, &amp;quot;moveElementLeft&amp;quot;)&lt;br /&gt;
	bindKey(&amp;quot;right&amp;quot;, &amp;quot;moveElementRight&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
//sets selectedElement if a player clicks on one&lt;br /&gt;
function onPlayerLeftClick()&lt;br /&gt;
	if (selectedElem) then&lt;br /&gt;
		unMountElementToCam()&lt;br /&gt;
		selectedElem = nil&lt;br /&gt;
	else&lt;br /&gt;
		x1, y1, z1 = getCamPos()&lt;br /&gt;
		r = getCamRot()&lt;br /&gt;
		x2, y2, z2 = some trig stuff&lt;br /&gt;
		elem = processLineOfSite(x1, y1, z1, x2, y2, z2)&lt;br /&gt;
		if (elem) then&lt;br /&gt;
			mountElementToCam(elem, 10)&lt;br /&gt;
			selectedElement = elem&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function onPlayeRightClick()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function moveElementUp(key, keySTate)&lt;br /&gt;
	if (selectedElement) then&lt;br /&gt;
		if (keyState == &amp;quot;down&amp;quot;) then&lt;br /&gt;
			moveElement(selectedElement, ...) // move up&lt;br /&gt;
		else&lt;br /&gt;
			stopElementMoving(selectedElement)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function moveElementDown(key, keySTate)&lt;br /&gt;
	// similar to above&lt;br /&gt;
	...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function moveElementRight(key, keySTate)&lt;br /&gt;
	// similar to above&lt;br /&gt;
	...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function moveElementLeft(key, keySTate)&lt;br /&gt;
	// similar to above&lt;br /&gt;
	...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SERVER:&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Erorr404</name></author>
	</entry>
</feed>