<?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=Moono</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=Moono"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Moono"/>
	<updated>2026-05-14T19:05:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnColShapeHit&amp;diff=59550</id>
		<title>OnColShapeHit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnColShapeHit&amp;diff=59550"/>
		<updated>2018-09-30T17:55:53Z</updated>

		<summary type="html">&lt;p&gt;Moono: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Note|The hit won't be detected if the [[element]] that entered the colshape is a colshape.}}&lt;br /&gt;
This event is triggered when a physical [[element]] hits a [[colshape]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element hitElement, bool matchingDimension&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''hitElement''': the [[element]] that entered the colshape.&lt;br /&gt;
*'''matchingDimension''': a [[boolean]] referring to whether the hit collision shape was in the same [[dimension]] as the element.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[colshape]] that got hit by a player or vehicle.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a hill area for a ''King of the hill'' gamemode.  When a player enters or leaves the area, it's announced in the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create our hill area for our gamemode&lt;br /&gt;
local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 )&lt;br /&gt;
&lt;br /&gt;
-- add hill_Enter as a handler for when a player enters the hill area&lt;br /&gt;
function hill_Enter ( thePlayer, matchingDimension )&lt;br /&gt;
        if getElementType ( thePlayer ) == &amp;quot;player&amp;quot; then --if the element that entered was player&lt;br /&gt;
                --let's get the name of the player&lt;br /&gt;
                local nameOfThePlayer = getPlayerName ( thePlayer )&lt;br /&gt;
	        --announce to everyone that the player entered the hill&lt;br /&gt;
	        outputChatBox ( nameOfThePlayer..&amp;quot; entered the zone!&amp;quot;, getRootElement(), 255, 255, 109 )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeHit&amp;quot;, hillArea, hill_Enter )&lt;br /&gt;
&lt;br /&gt;
-- add hill_Enter as a handler for when a player leaves the hill area&lt;br /&gt;
function hill_Exit ( thePlayer, matchingDimension )&lt;br /&gt;
        if getElementType ( thePlayer ) == &amp;quot;player&amp;quot; then --if the element that left was player&lt;br /&gt;
	        --check if the player is not dead&lt;br /&gt;
	        if isPlayerDead ( thePlayer ) ~= true then&lt;br /&gt;
                        --let's get the name of the player&lt;br /&gt;
                        local nameOfThePlayer = getPlayerName ( thePlayer )&lt;br /&gt;
	        	--if he was alive, announce to everyone that the player has left the hill&lt;br /&gt;
	        	outputChatBox ( nameOfThePlayer..&amp;quot; left the zone!&amp;quot;, getRootElement(), 255, 255, 109 )&lt;br /&gt;
	        end&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeLeave&amp;quot;, hillArea, hill_Exit )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Colshape events}}&lt;/div&gt;</summary>
		<author><name>Moono</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAnnounceValue&amp;diff=59209</id>
		<title>GetPlayerAnnounceValue</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAnnounceValue&amp;diff=59209"/>
		<updated>2018-09-20T09:19:06Z</updated>

		<summary type="html">&lt;p&gt;Moono: invalid template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{New feature/item|3.0104|1.0.4||This function retrieves a players ASE announce value under a certain key.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string getPlayerAnnounceValue ( element thePlayer, string key )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[player]]:getAnnounceValue||setPlayerAnnounceValue}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' This is the [[Player]] whos value you want to retrieve.&lt;br /&gt;
*'''key:''' The name of the key.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a ''string'' containing the requested value if a valid key was specified or ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command named &amp;quot;getscore&amp;quot; which outputs a players &amp;quot;score&amp;quot; value to his chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function getScore ( playerSource, cmdName )&lt;br /&gt;
    local scoreValue = getPlayerAnnounceValue ( playerSource, &amp;quot;score&amp;quot; )&lt;br /&gt;
    if ( scoreValue ) then&lt;br /&gt;
        outputChatBox ( &amp;quot;Your score: &amp;quot;..scoreValue, playerSource )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler ( &amp;quot;getscore&amp;quot;, getScore )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;br /&gt;
[[Category:Changes_in_1.0]]&lt;/div&gt;</summary>
		<author><name>Moono</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleEngineState&amp;diff=59198</id>
		<title>GetVehicleEngineState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleEngineState&amp;diff=59198"/>
		<updated>2018-09-19T18:59:30Z</updated>

		<summary type="html">&lt;p&gt;Moono: invalid template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3|1.0||This function returns a vehicle's engine state (on or off).}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getVehicleEngineState ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:getEngineState|engineState|setVehicleEngineState}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': the [[vehicle]] you wish to get the engine state of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns '''true''' if the vehicle's engine is started, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will switch the vehicle engine state with the command &amp;quot;/switchengine&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function switchEngine ( playerSource )&lt;br /&gt;
    local theVehicle = getPedOccupiedVehicle ( playerSource )&lt;br /&gt;
&lt;br /&gt;
    -- Check if the player is in any vehicle and if he is the driver&lt;br /&gt;
    if theVehicle and getVehicleController ( theVehicle ) == playerSource then&lt;br /&gt;
        local state = getVehicleEngineState ( theVehicle )&lt;br /&gt;
        setVehicleEngineState ( theVehicle, not state )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;switchengine&amp;quot;, switchEngine )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Moono</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Vehicle_functions&amp;diff=59197</id>
		<title>Template:Vehicle functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Vehicle_functions&amp;diff=59197"/>
		<updated>2018-09-19T17:36:41Z</updated>

		<summary type="html">&lt;p&gt;Moono: client only func&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[addVehicleSirens]]&lt;br /&gt;
*[[addVehicleUpgrade]]&lt;br /&gt;
*[[attachTrailerToVehicle]]&lt;br /&gt;
*[[blowVehicle]]&lt;br /&gt;
*[[createVehicle]]&lt;br /&gt;
*[[detachTrailerFromVehicle]]&lt;br /&gt;
*[[fixVehicle]]&lt;br /&gt;
*[[getModelHandling]]&lt;br /&gt;
*[[getOriginalHandling]]&lt;br /&gt;
*[[getTrainDirection]]&lt;br /&gt;
*[[getTrainPosition]]&lt;br /&gt;
*[[getTrainSpeed]]&lt;br /&gt;
{{New items|3.0160|1.6|&lt;br /&gt;
*[[getTrainTrack]]&lt;br /&gt;
|7485}}&lt;br /&gt;
*[[getVehicleColor]]&lt;br /&gt;
*[[getVehicleCompatibleUpgrades]]&lt;br /&gt;
*[[getVehicleController]]&lt;br /&gt;
*[[getVehicleDoorOpenRatio]]&lt;br /&gt;
*[[getVehicleDoorState]]&lt;br /&gt;
*[[getVehicleEngineState]]&lt;br /&gt;
*[[getVehicleHandling]]&lt;br /&gt;
*[[getVehicleHeadLightColor]]&lt;br /&gt;
*[[getVehicleLandingGearDown]]&lt;br /&gt;
*[[getVehicleLightState]]&lt;br /&gt;
*[[getVehicleMaxPassengers]]&lt;br /&gt;
*[[getVehicleModelFromName]]&lt;br /&gt;
*[[getVehicleName]]&lt;br /&gt;
*[[getVehicleNameFromModel]]&lt;br /&gt;
*[[getVehicleOccupant]]&lt;br /&gt;
*[[getVehicleOccupants]]&lt;br /&gt;
*[[getVehicleOverrideLights]]&lt;br /&gt;
*[[getVehiclePaintjob]]&lt;br /&gt;
*[[getVehiclePanelState]]&lt;br /&gt;
*[[getVehiclePlateText]]&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
*[[getVehicleRespawnPosition]]&lt;br /&gt;
*[[getVehicleRespawnRotation]]&lt;br /&gt;
|14053}}&lt;br /&gt;
*[[getVehicleSirenParams]]&lt;br /&gt;
*[[getVehicleSirens]]&lt;br /&gt;
*[[getVehicleSirensOn]]&lt;br /&gt;
*[[getVehicleTowedByVehicle]]&lt;br /&gt;
*[[getVehicleTowingVehicle]]&lt;br /&gt;
{{Deprecated items|3.0156|1.5.6|&lt;br /&gt;
*[[getVehicleTurnVelocity]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getVehicleTurretPosition]]&lt;br /&gt;
*[[getVehicleType]]&lt;br /&gt;
*[[getVehicleUpgradeOnSlot]]&lt;br /&gt;
*[[getVehicleUpgradeSlotName]]&lt;br /&gt;
*[[getVehicleUpgrades]]&lt;br /&gt;
*[[getVehicleVariant]]&lt;br /&gt;
*[[getVehicleWheelStates]]&lt;br /&gt;
*[[getVehiclesOfType]]&lt;br /&gt;
*[[isTrainDerailable]]&lt;br /&gt;
*[[isTrainDerailed]]&lt;br /&gt;
*[[isVehicleBlown]]&lt;br /&gt;
*[[isVehicleDamageProof]]&lt;br /&gt;
*[[isVehicleFuelTankExplodable]]&lt;br /&gt;
*[[isVehicleLocked]]&lt;br /&gt;
*[[isVehicleOnGround]]&lt;br /&gt;
*[[isVehicleTaxiLightOn]]&lt;br /&gt;
*[[removeVehicleSirens]]&lt;br /&gt;
*[[removeVehicleUpgrade]]&lt;br /&gt;
*[[resetVehicleExplosionTime]]&lt;br /&gt;
*[[resetVehicleIdleTime]]&lt;br /&gt;
*[[respawnVehicle]]&lt;br /&gt;
*[[setModelHandling]]&lt;br /&gt;
*[[setTrainDerailable]]&lt;br /&gt;
*[[setTrainDerailed]]&lt;br /&gt;
*[[setTrainDirection]]&lt;br /&gt;
*[[setTrainPosition]]&lt;br /&gt;
*[[setTrainSpeed]]&lt;br /&gt;
{{New items|3.0160|1.6|&lt;br /&gt;
*[[setTrainTrack]]&lt;br /&gt;
|7485}}&lt;br /&gt;
*[[setVehicleColor]]&lt;br /&gt;
*[[setVehicleDamageProof]]&lt;br /&gt;
*[[setVehicleDoorOpenRatio]]&lt;br /&gt;
*[[setVehicleDoorState]]&lt;br /&gt;
*[[setVehicleDoorsUndamageable]]&lt;br /&gt;
*[[setVehicleEngineState]]&lt;br /&gt;
*[[setVehicleFuelTankExplodable]]&lt;br /&gt;
*[[setVehicleHandling]]&lt;br /&gt;
*[[setVehicleHeadLightColor]]&lt;br /&gt;
*[[setVehicleIdleRespawnDelay]]&lt;br /&gt;
*[[setVehicleLandingGearDown]]&lt;br /&gt;
*[[setVehicleLightState]]&lt;br /&gt;
*[[setVehicleLocked]]&lt;br /&gt;
*[[setVehicleOverrideLights]]&lt;br /&gt;
*[[setVehiclePaintjob]]&lt;br /&gt;
*[[setVehiclePanelState]]&lt;br /&gt;
*[[setVehiclePlateText]]&lt;br /&gt;
*[[setVehicleRespawnDelay]]&lt;br /&gt;
*[[setVehicleRespawnPosition]]&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
*[[setVehicleRespawnRotation]]&lt;br /&gt;
|14280}}&lt;br /&gt;
*[[setVehicleSirens]]&lt;br /&gt;
*[[setVehicleSirensOn]]&lt;br /&gt;
*[[setVehicleTaxiLightOn]]&lt;br /&gt;
*[[setVehicleTurretPosition]]&lt;br /&gt;
{{Deprecated items|3.0156|1.5.6|&lt;br /&gt;
*[[setVehicleTurnVelocity]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setVehicleVariant]]&lt;br /&gt;
*[[setVehicleWheelStates]]&lt;br /&gt;
*[[spawnVehicle]]&lt;br /&gt;
*[[toggleVehicleRespawn]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Moono</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ClearElementVisibleTo&amp;diff=59181</id>
		<title>ClearElementVisibleTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ClearElementVisibleTo&amp;diff=59181"/>
		<updated>2018-09-17T16:05:47Z</updated>

		<summary type="html">&lt;p&gt;Moono: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function clears any settings added by setElementVisibleTo and restores an element to its default visibility.  This does not work with all entities - [[vehicle]]s, [[player]]s and [[object]]s are exempt. This is because these objects are required for accurate sync (they're physical objects). This function is particularily useful for changing the visibility of markers, radar blips and radar areas.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool clearElementVisibleTo ( element theElement )   &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:clearVisibility|||}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element in which you wish to restore to its default visibility&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example clears any visibility settings after a player dies, so everyone can see his blip for a short period&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- specify the getBlipAttachedTo function&lt;br /&gt;
function getBlipAttachedTo( thePlayer )&lt;br /&gt;
	local blips = getElementsByType( &amp;quot;blip&amp;quot; )&lt;br /&gt;
	for k, theBlip in ipairs( blips ) do&lt;br /&gt;
		if getElementAttachedTo( theBlip ) == thePlayer then&lt;br /&gt;
			return theBlip&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function clearVisibilityWasted ( totalammo, killer, killerweapon, bodypart ) -- when a player dies&lt;br /&gt;
    clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings of his blip&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWasted&amp;quot;, getRootElement(), clearVisibilityWasted  ) --add an event handler for onPlayerWasted&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Moono</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_weapon_functions&amp;diff=59180</id>
		<title>Template:Client weapon functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_weapon_functions&amp;diff=59180"/>
		<updated>2018-09-17T04:13:16Z</updated>

		<summary type="html">&lt;p&gt;Moono: already present in ped. there is place for this function.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[getOriginalWeaponProperty]]&lt;br /&gt;
*[[getSlotFromWeapon]]&lt;br /&gt;
*[[getWeaponIDFromName]]&lt;br /&gt;
*[[getWeaponNameFromID]]&lt;br /&gt;
*[[getWeaponProperty]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Moono</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=59179</id>
		<title>MoveObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=59179"/>
		<updated>2018-09-16T19:03:43Z</updated>

		<summary type="html">&lt;p&gt;Moono: Undo revision 59178 by Moono (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will smoothly move an object from its current position to a specified rotation and position.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool moveObject ( object theObject, int time, float targetx, float targety, float targetz, [ float moverx, float movery, float moverz, string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[object]]:move||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theObject:''' the object that will be moved.&lt;br /&gt;
* '''time:''' the time in milliseconds the object will arrive at the destination.&lt;br /&gt;
* '''targetx:''' the X value of the target position&lt;br /&gt;
* '''targety:''' the Y value of the target position&lt;br /&gt;
* '''targetz:''' the Z value of the target position&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''moverx:''' the rotation along the X axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''movery:''' the rotation along the Y axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''moverz:''' the rotation along the Z axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
*'''strEasingType:''' the [[Easing|easing function]] to use for the interpolation (default is &amp;quot;Linear&amp;quot;)&lt;br /&gt;
*'''fEasingPeriod:''' the period of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingAmplitude:''' the amplitude of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingOvershoot:''' the overshoot of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* ''true'' if the function moved the object succesfully.&lt;br /&gt;
* ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' This example moves every object in the game up 100 units in ten seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
allObjects = getElementsByType ( &amp;quot;object&amp;quot; )&lt;br /&gt;
for key, theObject in ipairs ( allObjects ) do&lt;br /&gt;
	local origX, origY, origZ = getElementPosition ( theObject ) --get the origanal position&lt;br /&gt;
	local newZ = origZ + 100 -- make a new z position&lt;br /&gt;
	moveObject ( theObject, 10000, origX, origY, newZ ) --move the object to this position in 10 seconds.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 2:''' This example created a model (of a bed) near a player called ''someguy'', if they exist in the game. It will then move the model towards the player over 3 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find a player called 'someguy'&lt;br /&gt;
someGuy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If a player called someguy was found then&lt;br /&gt;
if ( someGuy ) then&lt;br /&gt;
	-- Get the player's position&lt;br /&gt;
	x, y, z = getElementPosition ( someGuy )&lt;br /&gt;
	-- Create a bed (1700) object near to the player&lt;br /&gt;
	bed = createObject ( 1700, x + 5, y, z )&lt;br /&gt;
	-- Move the bed towards the player over 3 seconds (3000 milliseconds)&lt;br /&gt;
	moveObject ( bed, 3000, x, y, z )&lt;br /&gt;
	-- Tell the player in the chat box&lt;br /&gt;
	outputChatBox ( &amp;quot;Moving a bed towards you!&amp;quot;, someGuy )&lt;br /&gt;
else&lt;br /&gt;
	-- Tell everyone that a player called 'someguy' could not be found&lt;br /&gt;
	outputChatBox ( &amp;quot;Player someguy doesn't exist&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 3:''' This example creates a ball moving (in front of CJ's house in Grove Street) using easing functions. Test command is &amp;quot;/smove&amp;quot; for instance &amp;quot;/smove OutBounce&amp;quot;. This example is a serverside code but the same could be done clientside (adapting the command handler)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local START_POS = {2497.203125, -1672.4864501953, 12.640947341919}&lt;br /&gt;
local STOP_POS = {2480.2595214844, -1666.521484375, 12.640114784241}&lt;br /&gt;
local MOTION_DURATION = 5000&lt;br /&gt;
local WAIT_DURATION = 1000&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;smove&amp;quot;,&lt;br /&gt;
function (player, cmd, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	local x, y, z = unpack(START_POS)&lt;br /&gt;
	local object = createObject(1598, x, y, z)&lt;br /&gt;
	x, y, z = unpack(STOP_POS)&lt;br /&gt;
	&lt;br /&gt;
	period = period or 0.3&lt;br /&gt;
	amplitude = amplitude or 1.0&lt;br /&gt;
	overshoot = overshoot or 1.70158&lt;br /&gt;
	&lt;br /&gt;
	outputChatBox(string.format(&amp;quot;Server Easing %s %s %s %s&amp;quot;, strEasingType, tostring(period), tostring(amplitude), tostring(overshoot)))&lt;br /&gt;
	moveObject(object, MOTION_DURATION, x, y, z, 0, 0, 360, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	setTimer(destroyElement, MOTION_DURATION+WAIT_DURATION, 1, object)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 4:''' This example move a gate with easing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z = 2096.3, 1721, 12.7&lt;br /&gt;
local easing = &amp;quot;OutBounce&amp;quot;&lt;br /&gt;
local time = 2000&lt;br /&gt;
local gate = createObject(980, x,y,z, 0, 0, 63)&lt;br /&gt;
local marker = createMarker(x,y,z, &amp;quot;cylinder&amp;quot;, 12, 0, 0, 0, 0)&lt;br /&gt;
 &lt;br /&gt;
function moveGate(hitPlayer, matchingDimension)&lt;br /&gt;
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerHit&amp;quot;, marker, moveGate)&lt;br /&gt;
 &lt;br /&gt;
function moveBack()&lt;br /&gt;
    moveObject(gate, time, x, y, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerLeave&amp;quot;, marker, moveBack)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|8576|Object rotation is wrong after moveObject serverside}}&lt;br /&gt;
}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>Moono</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=59178</id>
		<title>MoveObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=59178"/>
		<updated>2018-09-16T19:01:27Z</updated>

		<summary type="html">&lt;p&gt;Moono: by standart&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will smoothly move an object from its current position to a specified rotation and position.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool moveObject ( object theObject, int time, float targetx, float targety, float targetz, [ float moverx, float movery, float moverz, string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[object]]:move||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theObject:''' the object that will be moved.&lt;br /&gt;
* '''time:''' the time in milliseconds the object will arrive at the destination.&lt;br /&gt;
* '''targetx:''' the X value of the target position&lt;br /&gt;
* '''targety:''' the Y value of the target position&lt;br /&gt;
* '''targetz:''' the Z value of the target position&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''moverx:''' the rotation along the X axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''movery:''' the rotation along the Y axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''moverz:''' the rotation along the Z axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
*'''strEasingType:''' the [[Easing|easing function]] to use for the interpolation (default is &amp;quot;Linear&amp;quot;)&lt;br /&gt;
*'''fEasingPeriod:''' the period of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingAmplitude:''' the amplitude of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingOvershoot:''' the overshoot of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* ''true'' if the function moved the object succesfully.&lt;br /&gt;
* ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' This example moves every object in the game up 100 units in ten seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
allObjects = getElementsByType ( &amp;quot;object&amp;quot; )&lt;br /&gt;
for key, theObject in ipairs ( allObjects ) do&lt;br /&gt;
	local origX, origY, origZ = getElementPosition ( theObject ) --get the origanal position&lt;br /&gt;
	local newZ = origZ + 100 -- make a new z position&lt;br /&gt;
	moveObject ( theObject, 10000, origX, origY, newZ ) --move the object to this position in 10 seconds.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 2:''' This example created a model (of a bed) near a player called ''someguy'', if they exist in the game. It will then move the model towards the player over 3 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find a player called 'someguy'&lt;br /&gt;
someGuy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If a player called someguy was found then&lt;br /&gt;
if ( someGuy ) then&lt;br /&gt;
	-- Get the player's position&lt;br /&gt;
	x, y, z = getElementPosition ( someGuy )&lt;br /&gt;
	-- Create a bed (1700) object near to the player&lt;br /&gt;
	bed = createObject ( 1700, x + 5, y, z )&lt;br /&gt;
	-- Move the bed towards the player over 3 seconds (3000 milliseconds)&lt;br /&gt;
	moveObject ( bed, 3000, x, y, z )&lt;br /&gt;
	-- Tell the player in the chat box&lt;br /&gt;
	outputChatBox ( &amp;quot;Moving a bed towards you!&amp;quot;, someGuy )&lt;br /&gt;
else&lt;br /&gt;
	-- Tell everyone that a player called 'someguy' could not be found&lt;br /&gt;
	outputChatBox ( &amp;quot;Player someguy doesn't exist&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 3:''' This example creates a ball moving (in front of CJ's house in Grove Street) using easing functions. Test command is &amp;quot;/smove&amp;quot; for instance &amp;quot;/smove OutBounce&amp;quot;. This example is a serverside code but the same could be done clientside (adapting the command handler)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local START_POS = {2497.203125, -1672.4864501953, 12.640947341919}&lt;br /&gt;
local STOP_POS = {2480.2595214844, -1666.521484375, 12.640114784241}&lt;br /&gt;
local MOTION_DURATION = 5000&lt;br /&gt;
local WAIT_DURATION = 1000&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;smove&amp;quot;,&lt;br /&gt;
function (player, cmd, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	local x, y, z = unpack(START_POS)&lt;br /&gt;
	local object = createObject(1598, x, y, z)&lt;br /&gt;
	x, y, z = unpack(STOP_POS)&lt;br /&gt;
	&lt;br /&gt;
	period = period or 0.3&lt;br /&gt;
	amplitude = amplitude or 1.0&lt;br /&gt;
	overshoot = overshoot or 1.70158&lt;br /&gt;
	&lt;br /&gt;
	outputChatBox(string.format(&amp;quot;Server Easing %s %s %s %s&amp;quot;, strEasingType, tostring(period), tostring(amplitude), tostring(overshoot)))&lt;br /&gt;
	moveObject(object, MOTION_DURATION, x, y, z, 0, 0, 360, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	setTimer(destroyElement, MOTION_DURATION+WAIT_DURATION, 1, object)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 4:''' This example move a gate with easing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z = 2096.3, 1721, 12.7&lt;br /&gt;
local easing = &amp;quot;OutBounce&amp;quot;&lt;br /&gt;
local time = 2000&lt;br /&gt;
local gate = createObject(980, x,y,z, 0, 0, 63)&lt;br /&gt;
local marker = createMarker(x,y,z, &amp;quot;cylinder&amp;quot;, 12, 0, 0, 0, 0)&lt;br /&gt;
 &lt;br /&gt;
function moveGate(hitPlayer, matchingDimension)&lt;br /&gt;
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerHit&amp;quot;, marker, moveGate)&lt;br /&gt;
 &lt;br /&gt;
function moveBack()&lt;br /&gt;
    moveObject(gate, time, x, y, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerLeave&amp;quot;, marker, moveBack)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|8576|Object rotation is wrong after moveObject serverside}}&lt;br /&gt;
}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>Moono</name></author>
	</entry>
</feed>