<?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=Lordmau5</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=Lordmau5"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Lordmau5"/>
	<updated>2026-04-27T15:46:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedCanBeKnockedOffBike&amp;diff=80900</id>
		<title>SetPedCanBeKnockedOffBike</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedCanBeKnockedOffBike&amp;diff=80900"/>
		<updated>2024-10-24T11:20:34Z</updated>

		<summary type="html">&lt;p&gt;Lordmau5: Add information about peds not getting knocked off bikes when it's set damage proof (The game apparently skips collisions when this is set)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function controls if a ped can fall of his bike by accident - namely by banging into a wall.&lt;br /&gt;
{{Note | This effect is not synced for peds. When the ped falls off, he will not have exited the vehicle. To get it working you need to call it each time the ped is streamed in &amp;amp; each time it gets a new syncer.}}&lt;br /&gt;
{{Note | The ped will not get knocked off a bike that is set damage proof through [[setVehicleDamageProof]]. Refer to the note on that method for more information.}}&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 setPedCanBeKnockedOffBike ( ped thePed, bool canBeKnockedOffBike )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{OOP||[[ped]]:setCanBeKnockedOffBike||canPedBeKnockedOffBike}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' the ped whose knockoffstatus is being changed&lt;br /&gt;
*'''canBeKnockedOffBike:''' ''true'' or ''false''&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example adds a console command with which the local player can toggle if he can fall off bikes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeCanBeKnockedOff()&lt;br /&gt;
    local canBeKnocked = canPedBeKnockedOffBike(localPlayer)&lt;br /&gt;
    local knockedText = canBeKnocked and &amp;quot;Now you can't be knocked off your bike.&amp;quot; or &amp;quot;Now you can be knocked off your bike.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    setPedCanBeKnockedOffBike(localPlayer, not canBeKnocked)&lt;br /&gt;
    outputChatBox(knockedText)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;knock&amp;quot;, changeCanBeKnockedOff)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_ped_functions}}&lt;/div&gt;</summary>
		<author><name>Lordmau5</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDamageProof&amp;diff=80899</id>
		<title>SetVehicleDamageProof</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDamageProof&amp;diff=80899"/>
		<updated>2024-10-24T11:20:05Z</updated>

		<summary type="html">&lt;p&gt;Lordmau5: Add information about peds not getting knocked off bikes when it's set damage proof (The game apparently skips collisions when this is set)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This functions makes a vehicle damage proof, so it won't take damage from bullets, hits, explosions or fire. A damage proof's vehicle health can still be changed via script.&lt;br /&gt;
{{Note | Setting a bike damage proof will have the side-effect of peds not being able to get knocked off anymore, even if [[setPedCanBeKnockedOffBike]] is set to true.&lt;br /&gt;
Consider using and cancelling the [[onVehicleDamage]] / [[onClientVehicleDamage]] events instead.}}&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 setVehicleDamageProof ( vehicle theVehicle, bool damageProof )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[vehicle]]:setDamageProof|damageProof|isVehicleDamageProof}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to make damage proof.&lt;br /&gt;
*'''damageProof:''' ''true'' is damage proof, ''false'' is damageable.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle was set damage proof succesfully, ''false'' if the arguments are invalid or it failed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example spawns a vehicle and sets it damage proof immediately.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
newvehicle = createVehicle(602, 0, 0, 6)&lt;br /&gt;
setVehicleDamageProof(newvehicle, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Lordmau5</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HasElementData&amp;diff=65433</id>
		<title>HasElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HasElementData&amp;diff=65433"/>
		<updated>2020-03-20T18:24:04Z</updated>

		<summary type="html">&lt;p&gt;Lordmau5: Improve upon the example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks if an element has [[element data]] available 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;bool hasElementData ( element theElement, string key [, bool inherit = true] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:hasData}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' This is the element with data you want to check.&lt;br /&gt;
*'''key:''' The name of the element data entry you want to check for. (Maximum 31 characters.)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''inherit:''' - toggles whether or not the function should go up the hierarchy to find the requested key in case the specified element doesn't have it.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns ''true'' if the element contains element data for ''key'', or ''false'' if the element doesn't exist or there is no data associated with the ''key''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs a player's favorite animal using a console function 'favoriteAnimal' if they have one set.&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot; name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function favoriteAnimal ( source, commandName, playerName )&lt;br /&gt;
    local thePlayer = source&lt;br /&gt;
	if playerName then -- see if a player was specified&lt;br /&gt;
        thePlayer = getPlayerFromName (playerName) -- get the player element for the specified player&lt;br /&gt;
        if not thePlayer then -- if we still couldn't find a player with the specified name...&lt;br /&gt;
            outputChatBox ( &amp;quot;Couldn't find '&amp;quot; .. playerName .. &amp;quot;'&amp;quot;, source ) -- display an error&lt;br /&gt;
            return&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if hasElementData ( thePlayer, &amp;quot;favoriteAnimal&amp;quot; ) then -- check if the player has a favorite animal set&lt;br /&gt;
        local favoriteAnimal = getElementData ( thePlayer, &amp;quot;favoriteAnimal&amp;quot; ) -- get the player's favorite animal&lt;br /&gt;
        outputChatBox ( getPlayerName ( thePlayer )..&amp;quot;'s favorite animal is: &amp;quot;..favoriteAnimal, source ) -- output the player's favorite animal&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox ( getPlayerName ( thePlayer )..&amp;quot; does not have a favorite animal!&amp;quot;, source ) -- output the player's lack of a favorite animal&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- Add a console command joinTime, that takes an optional parameter of a player's name&lt;br /&gt;
addCommandHandler ( &amp;quot;favoriteAnimal&amp;quot;, favoriteAnimal )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.5.7-20447|1.5.7-20447|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Lordmau5</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Element_functions&amp;diff=65431</id>
		<title>Template:Element functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Element_functions&amp;diff=65431"/>
		<updated>2020-03-20T17:55:27Z</updated>

		<summary type="html">&lt;p&gt;Lordmau5: Add hasElementData to the Wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[attachElements]]&lt;br /&gt;
*[[clearElementVisibleTo]]&lt;br /&gt;
*[[cloneElement]]&lt;br /&gt;
*[[createElement]]&lt;br /&gt;
*[[destroyElement]]&lt;br /&gt;
*[[detachElements]]&lt;br /&gt;
*[[getAllElementData]]&lt;br /&gt;
*[[getAttachedElements]]&lt;br /&gt;
*[[getElementAlpha]]&lt;br /&gt;
*[[getElementAttachedOffsets]]&lt;br /&gt;
*[[getElementAttachedTo]]&lt;br /&gt;
*[[getElementCollisionsEnabled]]&lt;br /&gt;
*[[getElementByID]]&lt;br /&gt;
*[[getElementByIndex]]&lt;br /&gt;
*[[getElementChild]]&lt;br /&gt;
*[[getElementChildren]]&lt;br /&gt;
*[[getElementChildrenCount]]&lt;br /&gt;
*[[getElementColShape]]&lt;br /&gt;
*[[getElementData]]&lt;br /&gt;
*[[getElementDimension]]&lt;br /&gt;
*[[getElementHealth]]&lt;br /&gt;
*[[getElementID]]&lt;br /&gt;
*[[getElementInterior]]&lt;br /&gt;
*[[getElementMatrix]]&lt;br /&gt;
*[[getElementModel]]&lt;br /&gt;
*[[getElementParent]]&lt;br /&gt;
*[[getElementPosition]]&lt;br /&gt;
*[[getElementRotation]]&lt;br /&gt;
*[[getElementSyncer]]&lt;br /&gt;
*[[getElementType]]&lt;br /&gt;
*[[getElementVelocity]]&lt;br /&gt;
*[[getElementZoneName]]&lt;br /&gt;
*[[getElementsByType]]&lt;br /&gt;
*[[getElementsWithinColShape]]&lt;br /&gt;
*[[getLowLODElement]]&lt;br /&gt;
*[[getRootElement]]&lt;br /&gt;
{{New items|3.0160|1.5.7|&lt;br /&gt;
*[[hasElementData]]&lt;br /&gt;
|20447}}&lt;br /&gt;
*[[isElement]]&lt;br /&gt;
*[[isElementAttached]]&lt;br /&gt;
*[[isElementCallPropagationEnabled]]&lt;br /&gt;
*[[isElementDoubleSided]]&lt;br /&gt;
*[[isElementFrozen]]&lt;br /&gt;
*[[isElementInWater]]&lt;br /&gt;
*[[isElementLowLOD]]&lt;br /&gt;
*[[isElementVisibleTo]]&lt;br /&gt;
*[[isElementWithinColShape]]&lt;br /&gt;
*[[isElementWithinMarker]]&lt;br /&gt;
*[[removeElementData]]&lt;br /&gt;
*[[setElementAlpha]]&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
* [[setElementAngularVelocity]]&lt;br /&gt;
* [[getElementAngularVelocity]]&lt;br /&gt;
|14165}}&lt;br /&gt;
*[[setElementAttachedOffsets]]&lt;br /&gt;
*[[setElementCallPropagationEnabled]]&lt;br /&gt;
*[[setElementCollisionsEnabled]]&lt;br /&gt;
*[[setElementData]]&lt;br /&gt;
*[[setElementDimension]]&lt;br /&gt;
*[[setElementDoubleSided]]&lt;br /&gt;
*[[setElementFrozen]]&lt;br /&gt;
*[[setElementHealth]]&lt;br /&gt;
*[[setElementID]]&lt;br /&gt;
*[[setElementInterior]]&lt;br /&gt;
*[[setElementModel]]&lt;br /&gt;
*[[setElementParent]]&lt;br /&gt;
*[[setElementPosition]]&lt;br /&gt;
*[[setElementRotation]]&lt;br /&gt;
*[[setElementSyncer]]&lt;br /&gt;
*[[setElementVelocity]]&lt;br /&gt;
*[[setElementVisibleTo]]&lt;br /&gt;
*[[setLowLODElement]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lordmau5</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementRotation&amp;diff=65374</id>
		<title>SetElementRotation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementRotation&amp;diff=65374"/>
		<updated>2020-03-12T19:34:49Z</updated>

		<summary type="html">&lt;p&gt;Lordmau5: Add rotation variable to OOP syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
Sets the rotation of elements according to the world (does not work with players that are on the ground).&lt;br /&gt;
{{Tip|New scripts should set '''conformPedRotation''' to ''true'' when using this function on [[Ped|peds]]. This will prevent quirky old behaviour.}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementRotation ( element theElement, float rotX, float rotY, float rotZ [, string rotOrder = &amp;quot;default&amp;quot;, bool conformPedRotation = false ] )       &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setRotation|rotation|getElementRotation}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element whose rotation will be set&lt;br /&gt;
*'''rotX:''' The element's rotation around the x axis in degrees&lt;br /&gt;
*'''rotY:''' The element's rotation around the y axis in degrees&lt;br /&gt;
*'''rotZ:''' The element's rotation around the z axis in degrees&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
*'''rotOrder:''' A string representing the rotation order desired when interpreting the provided [http://en.wikipedia.org/wiki/Euler_angles euler angles]. If omitted, default value is ''&amp;quot;default&amp;quot;''. Allowed values are:&lt;br /&gt;
**''&amp;quot;default&amp;quot;:'' default MTA behavior prior to 1.1, where rotation order depends on element type&lt;br /&gt;
**''&amp;quot;ZXY&amp;quot;:'' rotation about the Z axis (''up''), then about the resulting X axis (''right''), and finally about the resulting Y axis (''front''). This is the default rotation order for [[object|objects]]&lt;br /&gt;
**''&amp;quot;ZYX&amp;quot;:'' rotation about the Z axis (''up''), then about the resulting Y axis (''front''), and finally about the resulting X axis (''right''). This is the default rotation order for [[vehicle|vehicles]]&lt;br /&gt;
&lt;br /&gt;
The default rotation order for peds/players is -Z-Y-X but this rotation order (set using ''&amp;quot;default&amp;quot;'' on peds) can not be set manually on other element types since it only exists due to historical and backward compatibility reasons.&lt;br /&gt;
Specifying a rotation order other than ''&amp;quot;default&amp;quot;'' allows the same angles to be uniformly used on several elements without having to consider their type.&lt;br /&gt;
}}&lt;br /&gt;
{{New feature/item|3.0152|1.3.2|4680|&lt;br /&gt;
*'''conformPedRotation:''' ''Relevant only for peds and will be ignored for other element types.'' A bool which should be set to ''true'' to ensure the ped rotation is correctly set in all circumstances. Failing to set this argument may result in the ped rotation being inverted whilst it is in the air and other inconsistencies. The default value of false is for backward compatibility with scripts which may depend upon the incorrect behaviour.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element rotation was successfully set and ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
How to correctly set the rotation for a ped:&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function pedRotate ( )&lt;br /&gt;
    local rotX, rotY, rotZ = getElementRotation(localPlayer) -- get the local players's rotation&lt;br /&gt;
    setElementRotation(localPlayer,0,0,rotZ+10,&amp;quot;default&amp;quot;,true) -- turn the player 10 degrees clockwise&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;turn&amp;quot;, pedRotate )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a player used the command &amp;quot;turn&amp;quot; and they are the driver of a vehicle the vehicle will rotate 10 degrees clockwise&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function carRotate( )&lt;br /&gt;
    if isPedInVehicle(localPlayer) then -- if the local client is in a vehicle&lt;br /&gt;
        localVehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
        if getVehicleController(localVehicle) == localPlayer then -- if the local client is the controller (driver) of the vehicle&lt;br /&gt;
            local rotX, rotY, rotZ = getElementRotation(localVehicle) -- get the local client's vehicle rotation&lt;br /&gt;
            setElementRotation(localVehicle,rotX,rotY,rotZ+10) -- turn the vehicle 10 degrees clockwise&lt;br /&gt;
         end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;turn&amp;quot;, carRotate )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.1-9.04680|Added conformPedRotation argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_element_functions}}&lt;/div&gt;</summary>
		<author><name>Lordmau5</name></author>
	</entry>
</feed>