<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/AR/setElementHealth?action=history&amp;feed=atom</id>
	<title>AR/setElementHealth - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/AR/setElementHealth?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/setElementHealth&amp;action=history"/>
	<updated>2026-04-04T06:59:01Z</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=AR/setElementHealth&amp;diff=46589&amp;oldid=prev</id>
		<title>Jaber: Created page with &quot;{{Server client function}} __NOTOC__ هذه الوظيفة تعطي الالمنت او الشيئ دم .  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; bool setElementHealth ( element theElement,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AR/setElementHealth&amp;diff=46589&amp;oldid=prev"/>
		<updated>2016-02-09T17:46:21Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Server client function}} __NOTOC__ هذه الوظيفة تعطي الالمنت او الشيئ دم .  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool setElementHealth ( element theElement,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
هذه الوظيفة تعطي الالمنت او الشيئ دم .&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 setElementHealth ( element theElement, float newHealth )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:setHealth|health|}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' الالمنت او الشيئ الذي تريد اعطائه دم ويكون: شخص,سيارة,ابجكت.&lt;br /&gt;
*'''newHealth:'''  كمية الدم التي تريد اعطائها للالمنت او الشيئ .&lt;br /&gt;
&lt;br /&gt;
&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;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function hpSlap ( sourcePlayer, command, targetPlayerName )&lt;br /&gt;
    --ان كان الاعب يملك خاصية السلاب&lt;br /&gt;
    if not hasObjectPermissionTo(sourcePlayer, &amp;quot;command.slap&amp;quot;, false) then&lt;br /&gt;
        outputChatBox ( &amp;quot;You cannot use this command.&amp;quot;, sourcePlayer )--كلام بالشات&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    --يجلب الاعب من اسمه&lt;br /&gt;
    local targetPlayer = getPlayerFromName ( targetPlayerName )&lt;br /&gt;
   &lt;br /&gt;
    if targetPlayer then&lt;br /&gt;
        --يقول بأنقاص 20 دم&lt;br /&gt;
        setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - 20 )&lt;br /&gt;
    else&lt;br /&gt;
        &lt;br /&gt;
        outputChatBox ( &amp;quot;There is no player named &amp;quot; .. targetPlayerName .. &amp;quot;!&amp;quot;, sourcePlayer )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
--عند كتابة &amp;quot;hpslap&amp;quot;&lt;br /&gt;
addCommandHandler ( &amp;quot;hpslap&amp;quot;, hpSlap )&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;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Jaber</name></author>
	</entry>
</feed>