<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.gtaconnected.com/wiki/index.php?action=history&amp;feed=atom&amp;title=ScriptingExamples%2FVehicleBounceAndFixer</id>
	<title>ScriptingExamples/VehicleBounceAndFixer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gtaconnected.com/wiki/index.php?action=history&amp;feed=atom&amp;title=ScriptingExamples%2FVehicleBounceAndFixer"/>
	<link rel="alternate" type="text/html" href="https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/VehicleBounceAndFixer&amp;action=history"/>
	<updated>2026-04-28T22:43:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/VehicleBounceAndFixer&amp;diff=11215&amp;oldid=prev</id>
		<title>Vortrex at 10:58, 1 September 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/VehicleBounceAndFixer&amp;diff=11215&amp;oldid=prev"/>
		<updated>2025-09-01T10:58:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:58, 1 September 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Code ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Code ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/del&gt;Lua, Client-Side, GTAC versions 1.0.72 and newer:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{LuaCode|caption=&lt;/ins&gt;Lua, Client-Side, GTAC versions 1.0.72 and newer:|1=function polarToCartesian(pos, rad, radius)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{LuaCode&lt;/del&gt;|1=function polarToCartesian(pos, rad, radius)&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	--rad = rad + math.pi / 2&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	--rad = rad + math.pi / 2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	pos.x = pos.x + radius * math.cos(rad)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	pos.x = pos.x + radius * math.cos(rad)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vortrex</name></author>
	</entry>
	<entry>
		<id>https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/VehicleBounceAndFixer&amp;diff=3940&amp;oldid=prev</id>
		<title>Mex at 07:56, 16 August 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.gtaconnected.com/wiki/index.php?title=ScriptingExamples/VehicleBounceAndFixer&amp;diff=3940&amp;oldid=prev"/>
		<updated>2018-08-16T07:56:47Z</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;{{DISPLAYTITLE:Vehicle Bounce &amp;amp; Fixer}}&lt;br /&gt;
== Description ==&lt;br /&gt;
This code fixes the local player&amp;#039;s vehicle and also bounces the front of the vehicle up, every 10th of a second, if the player has typed &amp;lt;code&amp;gt;/bounce&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
Typing &amp;lt;code&amp;gt;/bounce&amp;lt;/code&amp;gt; will toggle vehicle bouncing on or off for the local player.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Lua, Client-Side, GTAC versions 1.0.72 and newer:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{LuaCode|1=function polarToCartesian(pos, rad, radius)&lt;br /&gt;
	--rad = rad + math.pi / 2&lt;br /&gt;
	pos.x = pos.x + radius * math.cos(rad)&lt;br /&gt;
	pos.y = pos.y + radius * math.sin(rad)&lt;br /&gt;
	return pos&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;#039;bounce&amp;#039;, function(cmd,args)&lt;br /&gt;
	if bounceTimer then&lt;br /&gt;
		clearInterval(bounceTimer)&lt;br /&gt;
		bounceTimer = nil&lt;br /&gt;
		boundTimer2Used = nil&lt;br /&gt;
	else&lt;br /&gt;
		local function boundCallback()&lt;br /&gt;
			if not localPlayer.vehicle then return end&lt;br /&gt;
			localPlayer.vehicle:fix()&lt;br /&gt;
			local t = localPlayer.vehicle.turnVelocity&lt;br /&gt;
			if not localPlayer.vehicle.flipped and t.x &amp;gt;= -0.03 and t.x &amp;lt;= 0.03 and t.y &amp;gt;= -0.03 and t.y &amp;lt;= 0.03 then&lt;br /&gt;
				local y = tonumber(args) or math.random(26, 32)/100.0&lt;br /&gt;
				localPlayer.vehicle.turnVelocity = polarToCartesian(t, localPlayer.vehicle.heading, y)&lt;br /&gt;
				boundTimer2Used = nil&lt;br /&gt;
				clearInterval(bounceTimer)&lt;br /&gt;
				bounceTimer = setInterval(boundCallback, 1200)&lt;br /&gt;
			elseif not boundTimer2Used then&lt;br /&gt;
				boundTimer2Used = true&lt;br /&gt;
				clearInterval(bounceTimer)&lt;br /&gt;
				bounceTimer = setInterval(boundCallback, 500)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		bounceTimer = setInterval(boundCallback, 1200)&lt;br /&gt;
	end&lt;br /&gt;
end)}}&lt;/div&gt;</summary>
		<author><name>Mex</name></author>
	</entry>
</feed>