<?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=King+Hjwalh</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=King+Hjwalh"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/King_Hjwalh"/>
	<updated>2026-04-16T09:04:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnVehicleDamage&amp;diff=39158</id>
		<title>OnVehicleDamage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnVehicleDamage&amp;diff=39158"/>
		<updated>2014-03-27T14:46:45Z</updated>

		<summary type="html">&lt;p&gt;King Hjwalh: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a vehicle is damaged.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float loss&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''loss''': A float representing the amount of health the vehicle lost.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[vehicle]] that got damaged.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example displays a message with the amount of health lost when a vehicle gets damaged. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function displayVehicleLoss(loss)&lt;br /&gt;
    local thePlayer = getVehicleOccupant(source)&lt;br /&gt;
    if(thePlayer) then -- Check there is a player in the vehicle&lt;br /&gt;
        outputChatBox(&amp;quot;Your vehicle just lost &amp;quot; .. tonumber(loss) .. &amp;quot; health.&amp;quot;, thePlayer) -- Display the message&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onVehicleDamage&amp;quot;, getRootElement(), displayVehicleLoss)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Vehicle events}}&lt;/div&gt;</summary>
		<author><name>King Hjwalh</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnVehicleDamage&amp;diff=39157</id>
		<title>OnVehicleDamage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnVehicleDamage&amp;diff=39157"/>
		<updated>2014-03-27T14:46:06Z</updated>

		<summary type="html">&lt;p&gt;King Hjwalh: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a vehicle is damaged.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float loss&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''loss''': A float representing the amount of health the vehicle lost.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[vehicle]] that got damaged.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example displays a message with the amount of health lost when a vehicle gets damaged. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function displayVehicleLoss(loss)&lt;br /&gt;
    local thePlayer = getVehicleOccupant(source)&lt;br /&gt;
    if(thePlayer) then -- Check there is a player in the vehicle&lt;br /&gt;
        outputChatBox(&amp;quot;Your vehicle just lost &amp;quot; .. tonumber(loss) .. &amp;quot; You Should Fix It health.&amp;quot;, thePlayer) -- Display the message&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onVehicleDamage&amp;quot;, getRootElement(), displayVehicleLoss)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Vehicle events}}&lt;/div&gt;</summary>
		<author><name>King Hjwalh</name></author>
	</entry>
</feed>