<?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=AlaaS</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=AlaaS"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/AlaaS"/>
	<updated>2026-04-03T18:21:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseInPosition&amp;diff=44895</id>
		<title>IsMouseInPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseInPosition&amp;diff=44895"/>
		<updated>2015-04-11T12:05:02Z</updated>

		<summary type="html">&lt;p&gt;AlaaS: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to check whether the mouse cursor/pointer is within a rectangular position&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isMouseInPosition ( int x, int y, int width, int height )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''x''': Left-most X position for detection (absolute)&lt;br /&gt;
* '''y''': Top-most Y position for detection (absolute)&lt;br /&gt;
* '''width''': Width for detection (absolute)&lt;br /&gt;
* '''heigh''': Height for detection (absolute)&lt;br /&gt;
&lt;br /&gt;
===Return===&lt;br /&gt;
Returns true/false depending on whether the mouse is within the specified position or not&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    function isMouseInPosition ( x, y, width, height )&lt;br /&gt;
    if ( not isCursorShowing ( ) ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    local sx, sy = guiGetScreenSize ( )&lt;br /&gt;
    local cx, cy = getCursorPosition ( )&lt;br /&gt;
    local cx, cy = ( cx * sx ), ( cy * sy )&lt;br /&gt;
    if ( cx &amp;gt;= x and cx &amp;lt;= x + width ) and ( cy &amp;gt;= y and cy &amp;lt;= y + height ) 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;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Changes the image when you move your cursor over it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    addEventHandler ( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function ( )&lt;br /&gt;
        local imgX, imgY, imgWidth, imgHeight = 50, 50, 200, 200&lt;br /&gt;
        dxDrawImage ( imgX, imgY, imgWidth, imgHeight, ( isMouseInPosition ( imgX, imgY, imgWidth, imgHeight ) and &amp;quot;myImage2.png&amp;quot; or &amp;quot;myImage.png&amp;quot; ), tocolor ( 255, 255, 255 ) )&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Author: Castillo&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>AlaaS</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMouseInPosition&amp;diff=44894</id>
		<title>IsMouseInPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMouseInPosition&amp;diff=44894"/>
		<updated>2015-04-11T12:04:36Z</updated>

		<summary type="html">&lt;p&gt;AlaaS: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to check whether the mouse cursor/pointer is within a rectangular position&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isMouseInPosition ( int x, int y, int width, int height )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''x''': Left-most X position for detection (absolute)&lt;br /&gt;
* '''y''': Top-most Y position for detection (absolute)&lt;br /&gt;
* '''width''': Width for detection (absolute)&lt;br /&gt;
* '''heigh''': Height for detection (absolute)&lt;br /&gt;
&lt;br /&gt;
===Return===&lt;br /&gt;
Returns true/false depending on whether the mouse is within the specified position or not&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    function isMouseInPosition ( x, y, width, height )&lt;br /&gt;
    if ( not isCursorShowing ( ) ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    local sx, sy = guiGetScreenSize ( )&lt;br /&gt;
    local cx, cy = getCursorPosition ( )&lt;br /&gt;
    local cx, cy = ( cx * sx ), ( cy * sy )&lt;br /&gt;
    if ( cx &amp;gt;= x and cx &amp;lt;= x + width ) and ( cy &amp;gt;= y and cy &amp;lt;= y + height ) 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;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Changes the image when you move your cursor over it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    addEventHandler ( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function ( )&lt;br /&gt;
        local imgX, imgY, imgWidth, imgHeight = 50, 50, 200, 200&lt;br /&gt;
        dxDrawImage ( imgX, imgY, imgWidth, imgHeight, ( isMouseInPosition ( imgX, imgY, imgWidth, imgHeight ) and &amp;quot;myImage2.png&amp;quot; or &amp;quot;myImage.png&amp;quot; ), tocolor ( 255, 255, 255 ) )&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Author: Castillo&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>AlaaS</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsBan&amp;diff=44893</id>
		<title>IsBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsBan&amp;diff=44893"/>
		<updated>2015-04-11T12:01:09Z</updated>

		<summary type="html">&lt;p&gt;AlaaS: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{New items|4.0132|1.4|&lt;br /&gt;
This function checks if the passed value is valid [[ban]].&lt;br /&gt;
}}&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 isBan ( ban theBan )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theValue:''' The value to check&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the value is a ban, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example chechks if the passed argument is a ban or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banRecieve ( ban )&lt;br /&gt;
if ban and isBan(ban) == true then&lt;br /&gt;
outputChatBox(&amp;quot;this is a ban!&amp;quot;)--Valid ban is recieved!&lt;br /&gt;
else&lt;br /&gt;
outputChatBox(&amp;quot;this is not a ban, this is a &amp;quot;..getElementType(ban))--if the argument is not a ban, then checks its type and output it into the chat box.&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function onBan ( ban ) -- This function will be triggered every time a player is banned.&lt;br /&gt;
banRecieve(ban)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerBan&amp;quot;, getRootElement(), onBan )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function sendWrongBanArguement()&lt;br /&gt;
vehicle = createVehicle(411,0,5,3)&lt;br /&gt;
object = createObject(2600,0,0,0)&lt;br /&gt;
ped = createPed(61,0,0,3)&lt;br /&gt;
banRecieve(vehicle)--sends a vehicle as an argument.&lt;br /&gt;
banRecieve(object)--sends an object as an argument.&lt;br /&gt;
banRecieve(ped)--sends a ped as an argument.&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;sendWrongArgument&amp;quot;,sendWrongBanArguement)&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;
{{Admin_functions}}&lt;br /&gt;
[[ru:isBan]]&lt;/div&gt;</summary>
		<author><name>AlaaS</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsBan&amp;diff=44891</id>
		<title>IsBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsBan&amp;diff=44891"/>
		<updated>2015-04-11T12:00:33Z</updated>

		<summary type="html">&lt;p&gt;AlaaS: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{New items|4.0132|1.4|&lt;br /&gt;
This function checks if the passed value is valid [[ban]].&lt;br /&gt;
}}&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 isBan ( ban theBan )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theValue:''' The value to check&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the value is a ban, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example chechks if the passed argument is a ban or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banRecieve ( ban )&lt;br /&gt;
if ban and isBan(ban) == true then&lt;br /&gt;
outputChatBox(&amp;quot;this is a ban!&amp;quot;)--Valid ban is recieved!&lt;br /&gt;
else&lt;br /&gt;
outputChatBox(&amp;quot;this is not a ban, this is a &amp;quot;..getElementType(ban))--if the argument is not a ban, then checks its type and output it into the chat box.&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
function onBan ( ban ) -- This function will be triggered every time a player is banned.&lt;br /&gt;
banRecieve(ban)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerBan&amp;quot;, getRootElement(), onBan )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function sendWrongBanArguement()&lt;br /&gt;
vehicle = createVehicle(411,0,5,3)&lt;br /&gt;
object = createObject(2600,0,0,0)&lt;br /&gt;
ped = createPed(61,0,0,3)&lt;br /&gt;
banRecieve(vehicle)--sends a vehicle as an argument.&lt;br /&gt;
banRecieve(object)--sends an object as an argument.&lt;br /&gt;
banRecieve(ped)--sends a ped as an argument.&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;sendWrongArgument&amp;quot;,sendWrongBanArguement)&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;
{{Admin_functions}}&lt;br /&gt;
[[ru:isBan]]&lt;/div&gt;</summary>
		<author><name>AlaaS</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsBan&amp;diff=44890</id>
		<title>IsBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsBan&amp;diff=44890"/>
		<updated>2015-04-11T11:59:38Z</updated>

		<summary type="html">&lt;p&gt;AlaaS: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
{{New items|4.0132|1.4|&lt;br /&gt;
This function checks if the passed value is valid [[ban]].&lt;br /&gt;
}}&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 isBan ( ban theBan )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theValue:''' The value to check&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the value is a ban, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example chechks if the passed argument is a ban or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banRecieve ( ban )&lt;br /&gt;
if ban and isBan(ban) == true then&lt;br /&gt;
outputChatBox(&amp;quot;this is a ban!&amp;quot;)--Valid ban is recieved!&lt;br /&gt;
else&lt;br /&gt;
outputChatBox(&amp;quot;this is not a ban, this is a &amp;quot;..getElementType(ban))--if the argument is not a ban, then checks its type and output it into the chat box.&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
function onBan ( ban ) -- This function will be triggered every time a player is banned.&lt;br /&gt;
banRecieve(ban)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerBan&amp;quot;, getRootElement(), onBan )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function sendWrongBanArguement()&lt;br /&gt;
vehicle = createVehicle(411,0,5,3)&lt;br /&gt;
object = createObject(2600,0,0,0)&lt;br /&gt;
ped = createPed(61,0,0,3)&lt;br /&gt;
banRecieve(vehicle)--sends a vehicle as an argument.&lt;br /&gt;
banRecieve(object)--sends an object as an argument.&lt;br /&gt;
banRecieve(ped)--sends a ped as an argument.&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;sendWrongArgument&amp;quot;,sendWrongBanArguement)&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;
{{Admin_functions}}&lt;br /&gt;
[[ru:isBan]]&lt;/div&gt;</summary>
		<author><name>AlaaS</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetXMLNodes&amp;diff=43259</id>
		<title>GetXMLNodes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetXMLNodes&amp;diff=43259"/>
		<updated>2014-12-12T12:38:31Z</updated>

		<summary type="html">&lt;p&gt;AlaaS: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;void getXMLNodes( string xmlfilename, string nodename)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''xmlfilename''': The xml file name and path&lt;br /&gt;
* '''nodename''': Node name in xml file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside/clientside&amp;quot; class=&amp;quot;server/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 getXMLNodes(xmlfile,nodename)&lt;br /&gt;
   local xml = xmlLoadFile(xmlfile)&lt;br /&gt;
   if xml then&lt;br /&gt;
      local ntable={}&lt;br /&gt;
      local a = 0&lt;br /&gt;
      while xmlFindChild(xml,nodename,a) do&lt;br /&gt;
         table.insert(ntable,a+1)&lt;br /&gt;
         ntable[a+1]={}&lt;br /&gt;
         local attrs = xmlNodeGetAttributes ( xmlFindChild(xml,nodename,a) )&lt;br /&gt;
         for name,value in pairs ( attrs ) do&lt;br /&gt;
            table.insert(ntable[a+1],name)&lt;br /&gt;
            ntable[a+1][name]=value&lt;br /&gt;
         end&lt;br /&gt;
         &lt;br /&gt;
         ntable[a+1][&amp;quot;nodevalue&amp;quot;]=xmlNodeGetValue(xmlFindChild(xml,nodename,a))&lt;br /&gt;
 &lt;br /&gt;
         a=a+1&lt;br /&gt;
      end&lt;br /&gt;
      return ntable&lt;br /&gt;
   else&lt;br /&gt;
      return {}&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;
&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;
local aTeam = getXMLNodes(&amp;quot;teams.xml&amp;quot;,&amp;quot;team&amp;quot;)&lt;br /&gt;
for ka,vc in ipairs(aTeam) do&lt;br /&gt;
    outputDebugString(vc.tag)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
XML&amp;lt;teams.xml&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;teams&amp;gt;&lt;br /&gt;
&amp;lt;team tag=&amp;quot;|OS|&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;teams&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: NeoN&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>AlaaS</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetProjectileCounter&amp;diff=41381</id>
		<title>SetProjectileCounter</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetProjectileCounter&amp;diff=41381"/>
		<updated>2014-08-13T14:36:39Z</updated>

		<summary type="html">&lt;p&gt;AlaaS: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
Will change the projectile counter timer which depending on the projectile type will do different things:&lt;br /&gt;
* Rockets and Grenades will explode when it hits 0&lt;br /&gt;
* Teargas may be a duration timer&lt;br /&gt;
* Satchels restart (we currently assume it doesn't cause an effect)&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setProjectileCounter ( projectile projectile, int timeToDetonate )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''projectile:''' The projectile to edit the timer of.&lt;br /&gt;
* '''timeToDetonate:''' The time in milliseconds to detonation.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' otherwise.&lt;br /&gt;
===Example===&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 bomberf(cmd, player, bombid, duration) -- This will get the arguments of /setbombtime &amp;lt;bombid&amp;gt; &amp;lt;duration in secondes&amp;gt;&lt;br /&gt;
if bombid and duration then -- Checks if the bombid and the duration are avaible.&lt;br /&gt;
result = setProjectileCounter( bombid, duration * 1000 )-- This will set the bomb requested in bombid counter to the requested duration.&lt;br /&gt;
if result then -- this checks if the code worked or no.&lt;br /&gt;
outputChatBox(&amp;quot;Timer of projectile :&amp;quot;..bombid..&amp;quot; set to :&amp;quot;..duration..&amp;quot; secodes&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;setbombtime&amp;quot;, bomberf)-- when player do /setbombtime this will trigger the bombrf function.&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|n/a|1.3.0-9.04555|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client projectile functions}}&lt;/div&gt;</summary>
		<author><name>AlaaS</name></author>
	</entry>
</feed>