<?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=AboShanab</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=AboShanab"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/AboShanab"/>
	<updated>2026-04-06T12:01:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Useful_Functions&amp;diff=41683</id>
		<title>Talk:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Useful_Functions&amp;diff=41683"/>
		<updated>2014-08-30T09:26:37Z</updated>

		<summary type="html">&lt;p&gt;AboShanab: /* getCountPlayerInTeam */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;there i wrote isElementInPhotograph()&lt;br /&gt;
enjoy&lt;br /&gt;
[[User:Drline|Drline]] 04:44, 30 October 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
== getCountPlayerInTeam ==&lt;br /&gt;
&lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if a specified [[ped]] or [[player]] is driving a [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool, vehicle isPedDrivingVehicle ( element ped )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
* '''ped''': a [[player]] or [[ped]] to check if it's driving a [[vehicle]] or not.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' and a vehicle if the specified ped is driving a [[vehicle]], ''false'' if it's not or a bad argument was passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&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 isPedDrivingVehicle(ped)&lt;br /&gt;
    assert(isElement(ped) and (getElementType(ped) == &amp;quot;ped&amp;quot; or getElementType(ped) == &amp;quot;player&amp;quot;), &amp;quot;Bad argument @ isPedDrivingVehicle [ped/player expected, got &amp;quot; .. tostring(ped) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
    local isDriving = isPedInVehicle(ped) and getVehicleOccupant(getPedOccupiedVehicle(ped)) == ped&lt;br /&gt;
    return isDriving, isDriving and getPedOccupiedVehicle(ped) or nil&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;
==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;
This example adds a /amidriving command which tells the player who types it if it's driving or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler ( &amp;quot;amidriving&amp;quot;,&lt;br /&gt;
	function ( player )&lt;br /&gt;
		local driving, vehicle = isPedDrivingVehicle ( player )&lt;br /&gt;
		if driving then&lt;br /&gt;
			outputChatBox ( &amp;quot;* You are driving a &amp;quot;..getVehicleName(vehicle)..&amp;quot;.&amp;quot;, player, 255, 255, 0, true )&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;* You are not driving.&amp;quot;, player, 255, 0, 0, true )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>AboShanab</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMapDM&amp;diff=37102</id>
		<title>IsMapDM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMapDM&amp;diff=37102"/>
		<updated>2013-09-13T11:29:04Z</updated>

		<summary type="html">&lt;p&gt;AboShanab: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function find in name map [DM] For Race.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isMapDM()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* none.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&lt;br /&gt;
Returns ''true'' if the [[map]] find in name [DM] , ''false'' if not find in name map [DM] .&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isMapDM()&lt;br /&gt;
   if getMapName():upper():find(&amp;quot;[DM]&amp;quot;) or getMapName():upper():find(&amp;quot;=DM=&amp;quot;) or getMapName():upper():find(&amp;quot;DM&amp;quot;) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&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;
==Example== &lt;br /&gt;
This example will check in name map [DM].&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;show&amp;quot;,function(player)&lt;br /&gt;
if ( isMapDM() ) then&lt;br /&gt;
outputChatBox(&amp;quot;This Map DM&amp;quot;,player,255,0,0,true)&lt;br /&gt;
end&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;
Author: AboShanab.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>AboShanab</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMapDM&amp;diff=37101</id>
		<title>IsMapDM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMapDM&amp;diff=37101"/>
		<updated>2013-09-13T10:53:34Z</updated>

		<summary type="html">&lt;p&gt;AboShanab: Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function find in name map [DM] For Race. ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isMapDM()&amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function find in name map [DM] For Race.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isMapDM()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* none.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&lt;br /&gt;
Returns ''true'' if the [[map]] find in name [DM] , ''false'' if not find in name map [DM] .&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isMapDM()&lt;br /&gt;
	if string.find(getMapName(), &amp;quot;[DM]&amp;quot;, 1, true) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&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;
==Example== &lt;br /&gt;
This example will check in name map [DM].&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;show&amp;quot;,function(player)&lt;br /&gt;
if ( isMapDM() ) then&lt;br /&gt;
outputChatBox(&amp;quot;This Map DM&amp;quot;,player,255,0,0,true)&lt;br /&gt;
end&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;
Author: AboShanab.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>AboShanab</name></author>
	</entry>
</feed>