<?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=Dakilla</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=Dakilla"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Dakilla"/>
	<updated>2026-04-25T00:53:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientGUIDoubleClick&amp;diff=22690</id>
		<title>OnClientGUIDoubleClick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientGUIDoubleClick&amp;diff=22690"/>
		<updated>2010-03-22T18:39:51Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is fired when the user double clicks a GUI element.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string button, string state, int absoluteX, int absoluteY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''button:''' the name of the mouse button that the GUI element was double clicked with.&lt;br /&gt;
*'''state:''' the state of the mouse button. &amp;quot;down&amp;quot; or &amp;quot;up&amp;quot;.&lt;br /&gt;
*'''absoluteX:''' the X position of the mouse cursor, in pixels, measured from the left side of the screen.&lt;br /&gt;
*'''absoluteY:''' the Y position of the mouse cursor, in pixels, measured from the top of the screen.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the GUI element that was double clicked.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example displays in chatbox name of double-clicked player in a gridlist.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( ),&lt;br /&gt;
    function ( )&lt;br /&gt;
        gridList = guiCreateGridList( 10, 200, 100, 50, false ); -- create a gridlist&lt;br /&gt;
        local col = guiGridListAddColumn( gridList, &amp;quot;Players&amp;quot;, .9 ); -- add &amp;quot;Players&amp;quot; column&lt;br /&gt;
&lt;br /&gt;
        local players = getElementsByType( &amp;quot;player&amp;quot; );&lt;br /&gt;
        for i, plr in pairs( players ) do -- loop through the table of players&lt;br /&gt;
            local row = guiGridListAddRow( gridList ); -- add row for player&lt;br /&gt;
            guiGridListSetItemText( gridList, row, col, getPlayerName( plr ), false, false ); -- change the text of the added row&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        addEventHandler( &amp;quot;onClientGUIDoubleClick&amp;quot;, gridList, doubleClickedName, false );&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
function doubleClickedName( )&lt;br /&gt;
    local selectedRow, selectedCol = guiGridListGetSelectedItem( gridList ); -- get double clicked item in the gridlist&lt;br /&gt;
    local playerName = guiGridListGetItemText( gridList, selectedRow, selectedCol ); -- get its text&lt;br /&gt;
    outputChatBox( &amp;quot;You double-clicked: &amp;quot; .. playerName ); -- display the text taken from gridlist&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===GUI events===&lt;br /&gt;
{{GUI_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Incomplete Event]]&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=22688</id>
		<title>AddBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=22688"/>
		<updated>2010-03-21T12:41:39Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will add a ban for the specified IP/username/serial to the server.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban addBan ( [ string IP, string Username, string Serial, player responsibleElement, string reason, int seconds = 0 ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note:''' One of the three: IP, Username or Serial have to be specified.&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''IP:''' The IP to be banned. If you don't want to ban by IP, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Username:''' The username to be banned. If you don't want to ban by username, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Serial:''' The serial to be banned. If you don't want to ban by serial, set this to ''nil''.&lt;br /&gt;
''' or any combination.'''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the IP/username/serial. This can be a player or the root ([[getRootElement]]()).&lt;br /&gt;
*'''reason:''' The reason the IP/username/serial will be banned from the server.&lt;br /&gt;
*'''seconds:''' The amount of seconds the player will be banned from the server for. This can be 0 for an infinite amount of time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the IP/username/serial was banned succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example bans a player's IP with the reason &amp;quot;Requested&amp;quot; when they type &amp;quot;/ban-me&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banMe ( source, command ) -- The function header and where source is defined&lt;br /&gt;
	local ipToBan = getPlayerIP ( source ) -- Get the player's IP&lt;br /&gt;
	addBan ( ipToBan, nil, nil, source, &amp;quot;Requested&amp;quot; ) -- Ban him with the reason; Requested&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban-me&amp;quot;, banMe ) -- Make it trigger when a player types &amp;quot;/ban-me&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example 2==&lt;br /&gt;
This example add command to ban player serial.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banSerial( source, command, noob, reason )&lt;br /&gt;
   if ( noob ) then&lt;br /&gt;
      local theNoob = getPlayerFromName( noob )&lt;br /&gt;
      if ( theNoob ) then&lt;br /&gt;
         local theNoobSerial = getPlayerSerial( theNoob )&lt;br /&gt;
         addBan( nil, nil, theNoobSerial, source, reason )&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;ban-serial&amp;quot;, banSerial )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin functions}}&lt;br /&gt;
[[ru:addBan]]&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22421</id>
		<title>IsPedDoingGangDriveby</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22421"/>
		<updated>2010-02-16T09:55:57Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the ped is in the driveby state.&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 isPedDoingGangDriveby ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] element whose state is to be checked.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''Server-Side:'''&lt;br /&gt;
Returns '''1''' if the driveby state is enabled, '''0''' otherwise.&lt;br /&gt;
* '''Client-Side:'''&lt;br /&gt;
Returns '''true''' if the driveby state is enabled, '''false''' otherwise.&lt;br /&gt;
&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;
This example turns on driveby mode when the local player types ''driveby'' in the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function setDoingDriveby ( )&lt;br /&gt;
        -- we check if local player isn't currently doing a gang driveby&lt;br /&gt;
        if not isPedDoingGangDriveby ( getLocalPlayer () ) then&lt;br /&gt;
                -- if he got driveby mode off, turn it on&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 4 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), true )&lt;br /&gt;
        else&lt;br /&gt;
                -- otherwise, turn it off&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 0 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), false )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;driveby&amp;quot;, setDoingDriveby )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22414</id>
		<title>IsPedDoingGangDriveby</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22414"/>
		<updated>2010-02-16T08:57:59Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the ped is in the driveby state.&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 isPedDoingGangDriveby ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] element whose state is to be checked.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
'''Server-Side:'''&lt;br /&gt;
Returns '''1''' if the driveby state is enabled, '''0''' otherwise.&lt;br /&gt;
'''Client-Side:'''&lt;br /&gt;
Returns '''true''' if the driveby state is enabled, '''false''' otherwise.&lt;br /&gt;
&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;
This example turns on driveby mode when the local player types ''driveby'' in the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function setDoingDriveby ( )&lt;br /&gt;
        -- we check if local player isn't currently doing a gang driveby&lt;br /&gt;
        if not isPedDoingGangDriveby ( getLocalPlayer () ) then&lt;br /&gt;
                -- if he got driveby mode off, turn it on&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 4 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), true )&lt;br /&gt;
        else&lt;br /&gt;
                -- otherwise, turn it off&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 0 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), false )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;driveby&amp;quot;, setDoingDriveby )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22413</id>
		<title>IsPedDoingGangDriveby</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22413"/>
		<updated>2010-02-15T20:02:23Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the ped is in the driveby state.&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 isPedDoingGangDriveby ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] element whose state is to be checked.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
'''Server-Side:'''&lt;br /&gt;
Returns '''1''' if the driveby state is enabled, '''0''' otherwise.&lt;br /&gt;
'''Client-Side:'''&lt;br /&gt;
Returns '''true''' if the driveby state is enabled, '''false''' otherwise.&lt;br /&gt;
&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;
This example turns on driveby mode when the local player types ''driveby'' in the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function setDoingDriveby ( )&lt;br /&gt;
        -- we check if local player isn't currently doing a gang driveby&lt;br /&gt;
        if isPedDoingGangDriveby ( getLocalPlayer () ) == 0 then&lt;br /&gt;
                -- if he got driveby mode off, turn it on&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 4 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), true )&lt;br /&gt;
        else&lt;br /&gt;
                -- otherwise, turn it off&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 0 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), false )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;driveby&amp;quot;, setDoingDriveby )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22412</id>
		<title>IsPedDoingGangDriveby</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22412"/>
		<updated>2010-02-15T20:00:14Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the ped is in the driveby state.&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 isPedDoingGangDriveby ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] element whose state is to be checked.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns '''1''' if the driveby state is enabled, '''0''' otherwise.&lt;br /&gt;
&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;
This example turns on driveby mode when the local player types ''driveby'' in the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function setDoingDriveby ( )&lt;br /&gt;
        -- we check if local player isn't currently doing a gang driveby&lt;br /&gt;
        if isPedDoingGangDriveby ( getLocalPlayer () ) == 0 then&lt;br /&gt;
                -- if he got driveby mode off, turn it on&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 4 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), true )&lt;br /&gt;
        else&lt;br /&gt;
                -- otherwise, turn it off&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 0 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), false )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;driveby&amp;quot;, setDoingDriveby )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22411</id>
		<title>IsPedDoingGangDriveby</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedDoingGangDriveby&amp;diff=22411"/>
		<updated>2010-02-15T19:59:35Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the ped is in the driveby state.&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 isPedDoingGangDriveby ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[ped]] element whose state is to be checked.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns '''1''' if the driveby state is enabled, '''0''' otherwise.&lt;br /&gt;
&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;
This example turns on driveby mode when the local player types ''driveby'' in the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function setDoingDriveby ( )&lt;br /&gt;
        -- we check if local player isn't currently doing a gang driveby&lt;br /&gt;
        if not isPedDoingGangDriveby ( getLocalPlayer () ) then&lt;br /&gt;
                -- if he got driveby mode off, turn it on&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 4 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), true )&lt;br /&gt;
        else&lt;br /&gt;
                -- otherwise, turn it off&lt;br /&gt;
                setPedWeaponSlot ( getLocalPlayer (), 0 )&lt;br /&gt;
                setPedDoingGangDriveby ( getLocalPlayer (), false )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;driveby&amp;quot;, setDoingDriveby )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleEngineState&amp;diff=22408</id>
		<title>SetVehicleEngineState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleEngineState&amp;diff=22408"/>
		<updated>2010-02-13T10:18:05Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function turns a vehicle's engine on or off. Note that the engine will always be turned on when someone enters the driver seat, unless you override that behaviour with scripts.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server and Client&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;
bool setVehicleEngineState ( vehicle theVehicle, bool engineState )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': The [[vehicle]] you wish to change the engine state of.&lt;br /&gt;
*'''engineState''': A boolean value representing whether the engine will be turned on (''true'') or off (''false'').&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle's engine state was successfully changed, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will turn off a vehicle's engine when the driver gets out of the car.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function turnEngineOff ( theVehicle, leftSeat, jackerPlayer )&lt;br /&gt;
    -- if it's the driver who got out, and he was not jacked,&lt;br /&gt;
    if leftSeat == 0 and not jackerPlayer then&lt;br /&gt;
        -- turn off the engine&lt;br /&gt;
        setVehicleEngineState ( theVehicle, false )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add 'turnEngineOff' as a handler for &amp;quot;onPlayerExitVehicle&amp;quot;&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerVehicleExit&amp;quot;, getRootElement ( ), turnEngineOff )&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;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTypeIndexFromClothes&amp;diff=22407</id>
		<title>GetTypeIndexFromClothes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTypeIndexFromClothes&amp;diff=22407"/>
		<updated>2010-02-13T10:02:24Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to get the clothes type and index from the texture and model.&lt;br /&gt;
(Scans through the list of clothes for the specific type).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int int getTypeIndexFromClothes ( string clothesTexture, string clothesModel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''clothesTexture''': A string determining the clothes texture that you wish to retrieve the type and index from. See the [[CJ Clothes|clothes catalog]].&lt;br /&gt;
*'''clothesModel''': A string determining the corresponding clothes model that you wish to retrieve the type and index from. See the [[CJ Clothes|clothes catalog]].&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns two integers, type and index respectively, ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the current clothes of a certain type on a player, then swaps with the previous in the clothes list.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptPreviousClothes ( thePlayer, key, clothesType )&lt;br /&gt;
  local currentTexture, currentModel = getPedClothes ( thePlayer, clothesType ) -- get the current clothes on this slot&lt;br /&gt;
  local clothesIndex = 1&lt;br /&gt;
  if ( currentTexture ) then -- if he had clothes of that type&lt;br /&gt;
    local tempA, tempB = getTypeIndexFromClothes ( currentTexture, currentModel ) -- get the type and index for these clothes, so we can decrease and get the previous in the list&lt;br /&gt;
    if ( tempA and tempB ) then -- if we found them&lt;br /&gt;
      clothesType, clothesIndex = tempA, tempB&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  clothesIndex = clothesIndex - 1&lt;br /&gt;
  local texture, model = getClothesByTypeIndex ( clothesType, clothesIndex ) -- get the new texture and model&lt;br /&gt;
  if ( texture == false ) then -- if we've reached the end of the list&lt;br /&gt;
    removePedClothes ( thePlayer, clothesType )&lt;br /&gt;
  else addPedClothes ( thePlayer, texture, model, clothesType )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;previousClothes&amp;quot;, scriptPreviousClothes )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Clothes and body functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundVolume&amp;diff=22333</id>
		<title>SetSoundVolume</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundVolume&amp;diff=22333"/>
		<updated>2010-01-26T18:46:00Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the volume level of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundVolume ( element theSound, float volume )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which volume you want to modify.&lt;br /&gt;
*'''volume:''' A [[float|floating]] point number representing the desired volume level.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element volume was successfully changed, ''false'' otherwise.&lt;br /&gt;
&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 wasted (killer, weapon, bodypart)&lt;br /&gt;
        local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) --Play wasted.mp3 from the sounds folder&lt;br /&gt;
        setSoundVolume(sound, 0.5) -- set the sound volume to 50%&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, getLocalPlayer(), wasted) --add the event handler &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;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundVolume&amp;diff=22332</id>
		<title>SetSoundVolume</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundVolume&amp;diff=22332"/>
		<updated>2010-01-26T18:44:22Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the volume level of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundVolume ( element theSound, float volume )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which volume you want to modify.&lt;br /&gt;
*'''volume:''' A [[floating|float]] point number representing the desired volume level.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element volume was successfully changed, ''false'' otherwise.&lt;br /&gt;
&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 wasted (killer, weapon, bodypart)&lt;br /&gt;
        local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) --Play wasted.mp3 from the sounds folder&lt;br /&gt;
        setSoundVolume(sound, 0.5) -- set the sound volume to 50%&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, getLocalPlayer(), wasted) --add the event handler &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;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetDistanceBetweenPointAndSegment2D&amp;diff=22329</id>
		<title>GetDistanceBetweenPointAndSegment2D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetDistanceBetweenPointAndSegment2D&amp;diff=22329"/>
		<updated>2010-01-24T13:47:49Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example */&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;
Takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getDistanceBetweenPointAndSegment2D(float pointX, float pointY, float x1, float y1, float x2, float y2)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''pointX''': The X coordinate of the point.&lt;br /&gt;
* '''pointY''': The Y coordinate of the point.&lt;br /&gt;
* '''x1''': The X coordinate of the starting point of the line.&lt;br /&gt;
* '''y1''': The Y coordinate of the starting point of the line.&lt;br /&gt;
* '''x2''': The X coordinate of the ending point of the line.&lt;br /&gt;
* '''y2''': The Y coordinate of the ending point of the line.&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 getDistanceBetweenPointAndSegment2D(pointX, pointY, x1, y1, x2, y2)&lt;br /&gt;
	local A = pointX - x1&lt;br /&gt;
	local B = pointY - y1&lt;br /&gt;
	local C = x2 - x1&lt;br /&gt;
	local D = y2 - y1&lt;br /&gt;
&lt;br /&gt;
	local point = A * C + B * D&lt;br /&gt;
	local lenSquare = C * C + D * D&lt;br /&gt;
	local parameter = point / lenSquare&lt;br /&gt;
&lt;br /&gt;
	local shortestX&lt;br /&gt;
	local shortestY&lt;br /&gt;
&lt;br /&gt;
	if parameter &amp;lt; 0 then&lt;br /&gt;
		shortestX = x1&lt;br /&gt;
    		shortestY = y1&lt;br /&gt;
	elseif parameter &amp;gt; 1 then&lt;br /&gt;
		shortestX = x2&lt;br /&gt;
		shortestY = y2&lt;br /&gt;
	else&lt;br /&gt;
		shortestX = x1 + parameter * C&lt;br /&gt;
		shortestY = y1 + parameter * D&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local distance = getDistanceBetweenPoints2D(pointX, pointY, shortestX, shortestY)&lt;br /&gt;
&lt;br /&gt;
	return distance&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;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This code draws a red line, enables mouse cursor and tells client how far from the line was clicked.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Draw a red line&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(),&lt;br /&gt;
	function()&lt;br /&gt;
		dxDrawLine(20, 20, 200, 100, tocolor(255, 0, 0))&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Show cursor&lt;br /&gt;
showCursor(true)&lt;br /&gt;
&lt;br /&gt;
-- Fires when left mouse button is clicked&lt;br /&gt;
function cursorPositionFromTheRedLine(button, state, clickedX, clickedY)&lt;br /&gt;
	-- Allow function to continue only if left button was pressed and button was pressed down&lt;br /&gt;
	if button ~= &amp;quot;left&amp;quot; or state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Calculate the distance&lt;br /&gt;
	local distance = getDistanceBetweenPointAndSegment2D(clickedX, clickedY, 20, 20, 200, 100)&lt;br /&gt;
&lt;br /&gt;
	-- Tell user the distance&lt;br /&gt;
	outputChatBox(&amp;quot;You clicked &amp;quot;..distance..&amp;quot; away from the Red Line!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Read mouse clicks&lt;br /&gt;
addEventHandler(&amp;quot;onClientClick&amp;quot;, root, cursorPositionFromTheRedLine)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Code from: http://www.allegro.cc/forums/thread/589720&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponSwitch&amp;diff=22286</id>
		<title>OnPlayerWeaponSwitch</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponSwitch&amp;diff=22286"/>
		<updated>2010-01-16T17:44:59Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player switches weapons.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int previousWeaponID, int currentWeaponID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''previousWeaponID''': An [[int|integer]] representing the [[weapons|weapon]] that was switched from&lt;br /&gt;
*'''currentWeaponID''': An [[int|integer]] representing the [[weapons|weapon]] that was switched to&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that switched his weapon.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example disables use of the minigun upon switch.  It should be noted that this can be done more efficiently clientside.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function weaponSwitchDisableMinigun ( previousWeaponID, currentWeaponID ) --when a player switches his weapon&lt;br /&gt;
     if currentWeaponID == 38 then --if the weapon ID is minigun&lt;br /&gt;
          toggleControl ( source, &amp;quot;fire&amp;quot;, false ) --disable the fire button&lt;br /&gt;
     else --otherwise&lt;br /&gt;
          toggleControl ( source, &amp;quot;fire&amp;quot;, true )  --enable it&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
--add an event handler for onPlayerWeaponSwitch&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWeaponSwitch&amp;quot;, getRootElement(), weaponSwitchDisableMinigun )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientPlayerChangeNick&amp;diff=22267</id>
		<title>OnClientPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientPlayerChangeNick&amp;diff=22267"/>
		<updated>2010-01-10T13:57:38Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example: ouputChatbox must be 'outputChatBox' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Incomplete Event]]&lt;br /&gt;
{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when a player changes his nickname.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string oldNick, string newNick&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick:''' the nickname the player had before.&lt;br /&gt;
*'''newNick:''' the new nickname of the player.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player that changed his nick&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This disallows changing a nick&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientPlayerChangeNick&amp;quot;, getRootElement(),&lt;br /&gt;
function()&lt;br /&gt;
  cancelEvent()&lt;br /&gt;
  outputChatBox( &amp;quot;You can't change your nick!&amp;quot;, source, 255, 0, 0, false )&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client player events===&lt;br /&gt;
{{Client_player_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleTaxiLightOn&amp;diff=22005</id>
		<title>IsVehicleTaxiLightOn</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleTaxiLightOn&amp;diff=22005"/>
		<updated>2009-12-01T20:08:59Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
[[Category:Needs_Example]]&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will get the taxi light state of a taxi (vehicle ID's 420 and 438)&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 isVehicleTaxiLightOn ( vehicle taxi )              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''taxi:''' The vehicle element of the taxi that you wish to get the light state of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the light is on, ''false'' otherwise.&lt;br /&gt;
&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;
This example binds the 'o' key to a function that toggles the taxi's light on and off, if you're in a taxi.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function toggleTaxiLight()&lt;br /&gt;
	local thePlayer = getLocalPlayer()&lt;br /&gt;
	local theVehicle = getPedOccupiedVehicle(thePlayer)&lt;br /&gt;
	if thePlayer == getVehicleOccupant(theVehicle, 0) then -- if is a driver&lt;br /&gt;
		local lights = getVehicleTaxiLightOn(theVehicle) -- getting vehicle lights state&lt;br /&gt;
		local id = getElementModel(theVehicle) -- getting vehicle model&lt;br /&gt;
		if ((id == 420) or (id== 438)) then -- if is a taxi&lt;br /&gt;
			setVehicleTaxiLightOn(theVehicle, not lights) -- switch lights&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bind(&amp;quot;o&amp;quot;, &amp;quot;down&amp;quot;, toggleTaxiLight) -- binding the function&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;
==See Also==&lt;br /&gt;
{{vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleTaxiLightOn&amp;diff=21995</id>
		<title>IsVehicleTaxiLightOn</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleTaxiLightOn&amp;diff=21995"/>
		<updated>2009-11-30T16:51:13Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: fixed a typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
[[Category:Needs_Example]]&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will get the taxi light state of a taxi (vehicle ID's 420 and 438)&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 isVehicleTaxiLightOn ( vehicle taxi )              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''taxi:''' The vehicle element of the taxi that you wish to get the light state of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the light is on, ''false'' otherwise.&lt;br /&gt;
&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 myfunction()&lt;br /&gt;
	local player = getLocalPlayer()&lt;br /&gt;
	local vehicle = getPedOccupiedVehicle(player)&lt;br /&gt;
	if player == getVehicleOccupant(vehicle, 0) then -- if is a driver&lt;br /&gt;
		local lights = getVehicleTaxiLightOn(vehicle) -- getting vehicle lights state&lt;br /&gt;
		local id = getElementModel(vehicle) -- getting vehicle model&lt;br /&gt;
		if ((id == 420) or (id== 438)) then -- if is a taxi&lt;br /&gt;
			setVehicleTaxiLightOn(vehicle, not lights) -- switch lights&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bind(&amp;quot;o&amp;quot;, &amp;quot;down&amp;quot;, myfunction) -- binding the function&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;
==See Also==&lt;br /&gt;
{{vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=21985</id>
		<title>SetSoundPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=21985"/>
		<updated>2009-11-29T08:44:06Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the seek position of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPosition ( element theSound, int pos )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which seek position you want to modify.&lt;br /&gt;
*'''pos:''' An [[int]]eger value representing the new seek position of the sound in milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example allows the player to set how many milliseconds into the song he wants it to play from&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function setSongPos(cmd, ms)&lt;br /&gt;
    local ssp = setSoundPosition(theSound, ms)&lt;br /&gt;
    if(ssp == true) then&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(&amp;quot;Sound is now playing from: &amp;quot;..seconds..&amp;quot; Seconds!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;An error has occured. Please make shore there are atleast&amp;quot;)&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(seconds..&amp;quot; Seconds in this song!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;skipsong&amp;quot;, setSongPos)&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;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=21984</id>
		<title>SetSoundPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=21984"/>
		<updated>2009-11-29T08:43:54Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: outputChatBox client-side doesnt have a 'visibleTo' parameter!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the seek position of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPosition ( element theSound, int pos )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which seek position you want to modify.&lt;br /&gt;
*'''pos:''' An [[int]]eger value representing the new seek position of the sound in milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example allows the player to set how many milliseconds into the song he wants it to play from&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function setSongPos(cmd, ms)&lt;br /&gt;
    local ssp = setSoundPosition(theSound, ms)&lt;br /&gt;
    if(ssp == true) then&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(&amp;quot;Sound is now playing from: &amp;quot;..seconds..&amp;quot; Seconds!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;An error has occured. Please make shore there are atleast&amp;quot;))&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(seconds..&amp;quot; Seconds in this song!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;skipsong&amp;quot;, setSongPos)&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;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundPaused&amp;diff=21983</id>
		<title>IsSoundPaused</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundPaused&amp;diff=21983"/>
		<updated>2009-11-28T19:28:44Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to return the current pause state of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundPaused ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which pause state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is paused, ''false'' if unpaused or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will check and see if the sound is paused or not, and tell the player.&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function checkSongPause()&lt;br /&gt;
    local pause = isSoundPaused(theSound)&lt;br /&gt;
    if(pause == true) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is paused!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not paused!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;checkpause&amp;quot;, checkSongPause)&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;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWeaponAmmo&amp;diff=21934</id>
		<title>SetWeaponAmmo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWeaponAmmo&amp;diff=21934"/>
		<updated>2009-11-14T14:42:33Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Optional Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}} &lt;br /&gt;
Sets the ammo to a certain amount for a specified weapon (if they already have it), regardless of current ammo.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setWeaponAmmo ( player thePlayer, int weapon, int totalAmmo, [int ammoInClip = 0] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' A [[player]] object referencing the specified player  &lt;br /&gt;
*'''weapon:''' A whole number integer that refers to a [[weapon]] ID.&lt;br /&gt;
*'''totalAmmo:''' A whole number integer serving as the total ammo amount for the given weapon (including ammo in clip).&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''ammoInClip:''' The amount of ammo to set in the player's clip.  This will be taken from the main ammo.  If left unspecified or set to 0, the current clip will remain.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a boolean value ''true'' or ''false'' that tells you if it was successful or not.&lt;br /&gt;
&lt;br /&gt;
==Example==  &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Weapon functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;br /&gt;
[[ru:setWeaponAmmo]]&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RU/Resource:Editor&amp;diff=21911</id>
		<title>RU/Resource:Editor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/Resource:Editor&amp;diff=21911"/>
		<updated>2009-11-09T12:21:28Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Создание новых элементов */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RU/Resource page}}&lt;br /&gt;
{{translate}}&lt;br /&gt;
MTA:SA Редактор Карт позволяет создавать карты для вашего игрового мода.&lt;br /&gt;
&lt;br /&gt;
==Начало==&lt;br /&gt;
Чтобы запустить редактор, просто нажмите на кнопку &amp;quot;Map editor&amp;quot; в главном меню MTA.&lt;br /&gt;
&lt;br /&gt;
==Меню==&lt;br /&gt;
После запуска вы увидите два меню: в главном меню вверху, и элемент меню в левом нижнем углу.&lt;br /&gt;
&lt;br /&gt;
===Главное меню===&lt;br /&gt;
Это меню состоит из нескольких кнопок:&lt;br /&gt;
* [[Image:Editor_New.png]] Создать новую карту.&lt;br /&gt;
* [[Image:Editor_Open.png]] Открыть существующую карту.&lt;br /&gt;
* [[Image:Editor_Save.png]] Сохранить карту.&lt;br /&gt;
* [[Image:Editor_Save_as.png]] Сохраните карту под другим именем.&lt;br /&gt;
* [[Image:Editor_Options.png]] Общие настройки карты.&lt;br /&gt;
* [[Image:Editor_Undo.png]] Отменить последнее действие.&lt;br /&gt;
* [[Image:Editor_Redo.png]] Восстановить отмененное действие.&lt;br /&gt;
* [[Image:Editor_Locations.png]] Сохраненные местоположения мира игры. Редактор идет с большим списком местоположений Интерьера San Andreas, но Вы можете также добавить свои собственные внутренние и внешние местоположения к списку.&lt;br /&gt;
* [[Image:Editor_Current_elements.png]] Все элементы, которые содержит карта (Объекты, транспорт маркеры, пикапы и т. п.)&lt;br /&gt;
* [[Image:Editor_Map_settings.png]] Настройки карты, такие как как время дня, сила тяжести и т.д. Здесь Вы можете также определить, с каким модом (gamemode) будет совместима ваша карта&lt;br /&gt;
* [[Image:Editor_Definitions.png]] Загрузить [[Resource:Editor/EDF|editor definition files (EDF)]]которые вы хотите использовать. &lt;br /&gt;
* [[Image:Editor_Test.png]] Вход в игру для тестирования вашей карты.&lt;br /&gt;
&lt;br /&gt;
===Элементы меню===&lt;br /&gt;
Эти кнопки позволяют добавлять новые объекты на вашу карту.&lt;br /&gt;
* [[Image:Editor_Vehicle.png]] Создать новую машину.&lt;br /&gt;
* [[Image:Editor_Object.png]] Создать новый объект (Здания, дороги и другие декорации).&lt;br /&gt;
* [[Image:Editor_Pickup.png]] Создать новый пикап.&lt;br /&gt;
* [[Image:Editor_Marker.png]] Создать новый маркер.&lt;br /&gt;
&lt;br /&gt;
Additionally, if you have [[Resource:Editor/EDF|editor definitions loaded]], you can roll the mousewheel in this menu to bring up custom elements.&lt;br /&gt;
&lt;br /&gt;
==Использование редактора==&lt;br /&gt;
Этот раздел научит вас создавать и редактировать карты.&lt;br /&gt;
&lt;br /&gt;
===Перемещение по карте===&lt;br /&gt;
Когда вы запускаете редактор, у вас включен режим ''camera mode''(Режим камеры).  Используйте клавиши '''WSAD''' и мышь для управления камерой.  Если вам нужно перемещать объект или камеру медленнее, зажмите'''ALT''', для быстрого перемещения, используйте '''SHIFT'''.&lt;br /&gt;
&lt;br /&gt;
Чтобы получить доступ к панели управления редактором, перейдите в ''cursor mode''(Режим курсора).  Вы можете переключаться между режимом курсора и режимом камеры, нажимая  '''F'''.  Когда вы в режиме курсора, позиция камеры зафиксирована, и вы можете использовать курсор для управления элементами карты и интерфейсом.&lt;br /&gt;
&lt;br /&gt;
Режим камеры может быть полезен для быстрого перемещения по карте. Вы можете использовать его для выбора и перемещения элементов.&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Crosshair.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Запуск карты===&lt;br /&gt;
* Запустите редактор, выберите в меню ''New''.&lt;br /&gt;
* Выберите ''Map settings''. В разделе ''Meta'' заполните все поля. Откройте ''Gamemodes'' и добавьте игровой мод к вашей карте (Переместите их в список ''Added gamemodes''). Вы можете делать это выбирая и нажимая ''Add'', или двойным кликом по нему. Нажмите ОК когда закончите.&lt;br /&gt;
[[Image:Editor_Mapsettings.png|center]]&lt;br /&gt;
* Выберите пункт ''Definitions'' и добавьте ресурсы, которые вы хотите использовать как стандартные элементы. These will consist of the gamemodes you selected in the ''Map settings'' window, plus eventual additional resources. For more information about editor definitions, see [[Resource:Editor/EDF|EDF]]. Click OK when you're done.&lt;br /&gt;
&lt;br /&gt;
===Создание новых элементов===&lt;br /&gt;
Добавлять новые элементы на карту очень просто!&lt;br /&gt;
* Если вы в режиме камеры, переключитесь к курсору кнопкой '''F'''.&lt;br /&gt;
* Кликните о нужной кнопке добавления объекта. Например, нажмите на кнопку Car для добавления автомобилей.&lt;br /&gt;
* Созданные вами объекты можно двигать.Зажмите на объекте левую кнопку мыши и перемещайте его.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Addelem.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create custom elements that are specific to a resource, hover the cursor over the element menu and turn the scroll wheel until the desired resource comes up. Note that for this to work, you first have to add the [[Resource:Editor/EDF|EDF]] file of the resource in the ''Definitions'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Selectedf.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Выбор===&lt;br /&gt;
* '''Left click''' an element to select it in ''keyboard mode''.&lt;br /&gt;
* '''Right click''' it to select it in ''mouse mode''.&lt;br /&gt;
* Press the '''Spacebar''' or click in an empty area to deselect.&lt;br /&gt;
&lt;br /&gt;
The selected element, if any, is denoted by a yellow cone marker.  Elements (particularly objects) with poor collisions can be detected easier by enabling ''High sensitivity mode'', by pressing the '''E''' key.  This increases detection at the expense of accuracy.&lt;br /&gt;
&lt;br /&gt;
The ''Current elements'' dialog can also be used to select elements.  Double-clicking an item within the list will select it in ''Keyboard mode''.&lt;br /&gt;
&lt;br /&gt;
===Перемещение===&lt;br /&gt;
Moving elements can be done in several ways.&lt;br /&gt;
&lt;br /&gt;
'''With the mouse'''&lt;br /&gt;
* Simply drag and drop with the '''left mouse button'''.&lt;br /&gt;
Or:&lt;br /&gt;
* Select the element in mouse mode ('''right click'''), move it to where you want it, and click to drop it off.&lt;br /&gt;
&lt;br /&gt;
You can also adjust the ''Hold distance'' of an element toward and away from the camera by switching to camera mode, '''right clicking''' the element, and rolling the '''mouse wheel'''.&lt;br /&gt;
&lt;br /&gt;
'''With the keyboard'''&lt;br /&gt;
* Select the element in keyboard mode ('''left click''').&lt;br /&gt;
* Use the '''arrow keys''' to move the element in the horizontal plane, and '''PgUp'''/'''PgDn''' to move it vertically. Hold '''ALT''' to decrease the movement speed, or '''SHIFT''' to increase it.&lt;br /&gt;
&lt;br /&gt;
By default, elements move relative to the camera and are not locked to any axes.  This can be disabled in the ''Options'' menu.&lt;br /&gt;
&lt;br /&gt;
===Вращение===&lt;br /&gt;
'''With the mouse'''&lt;br /&gt;
&lt;br /&gt;
You can rotate selected elements around the Z axis with the mouse wheel.&lt;br /&gt;
* Select the element in keyboard mode ('''left click''') and roll the mouse wheel while holding '''Left CTRL'''.&lt;br /&gt;
Or:&lt;br /&gt;
* Select the element in mouse mode ('''right click'''), hold '''CTRL''', and roll the mouse wheel.&lt;br /&gt;
&lt;br /&gt;
'''With the keyboard'''&lt;br /&gt;
* Select the element in keyboard mode ('''left click''').&lt;br /&gt;
* While holding '''CTRL''' (the selection marker will turn green), use the '''arrow keys''' and '''PgUp'''/'''PgDn''' to rotate the element around the different axes.&lt;br /&gt;
&lt;br /&gt;
With both methods you can additionally hold '''ALT''' to decrease the rotation speed or '''SHIFT''' to increase it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Rotateelem.png|center]]&lt;br /&gt;
&lt;br /&gt;
==Настройки модели==&lt;br /&gt;
У большинства элементов есть множество вариантов настроек, которые нужны, чтобы изменить их внешность и поведение. Примеры - модель, цвет и визуальные модернизации автомобиля.&lt;br /&gt;
&lt;br /&gt;
* Откройте окно свойств элемента двойным щелчком на нем или нажав клавишу &amp;quot;F3&amp;quot;.&lt;br /&gt;
* Сделайте изменения по вашему усмотрению. Например, чтобы изменить модель автомобиля или объекта, щелкните кнопку &amp;quot;Browse &amp;quot; рядом с &amp;quot;model&amp;quot;, чтобы открыть браузер моделей.&lt;br /&gt;
* Нажмите OK для закрытия и сохранения.&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Props.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Копирование===&lt;br /&gt;
Вы можете клонировать элемент, выбирая его и нажимая C. &lt;br /&gt;
&lt;br /&gt;
* In mouse mode the cloned element will be attached to your cursor. '''Left click''' to place it in the map.&lt;br /&gt;
* In keyboard mode the cloned element will be cloned in the identical position.&lt;br /&gt;
&lt;br /&gt;
If you hold '''CTRL''' while clicking, the element will be cloned again and will again be attached to the cursor. This way you can easily place large quantities of something.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can use the ''Pullout'' button located in the bottom-right corner of the properties box to clone an element.&lt;br /&gt;
&lt;br /&gt;
===Удаление===&lt;br /&gt;
Simply select the element and press '''DEL''' ''(Delete)''.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can use the ''Pullout'' button located in the bottom-right corner of the properties box to delete an element.&lt;br /&gt;
&lt;br /&gt;
==Управление==&lt;br /&gt;
Here is a list of all default controls. To change them please go to the MTA Settings menu while the Editor is started.&lt;br /&gt;
&lt;br /&gt;
===Камера===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| camera_move_forwards&lt;br /&gt;
| '''w'''&lt;br /&gt;
|-&lt;br /&gt;
| camera_move_backwards&lt;br /&gt;
| '''s'''&lt;br /&gt;
|-&lt;br /&gt;
| camera_move_left&lt;br /&gt;
| '''a'''&lt;br /&gt;
|-&lt;br /&gt;
| camera_move_right&lt;br /&gt;
| '''d'''&lt;br /&gt;
|-&lt;br /&gt;
| high_sensitivity_mode&lt;br /&gt;
| '''e'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Клонирование===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| клонировать выбранный элемент&lt;br /&gt;
| '''c'''&lt;br /&gt;
|-&lt;br /&gt;
| clone_drop_modifier&lt;br /&gt;
| '''lctrl''' || ''(Left CTRL)''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Манипуляции с элементами===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| element_move_forward&lt;br /&gt;
| '''arrow_u''' || ''(Arrow key Up)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_backward&lt;br /&gt;
| '''arrow_d''' || ''(Arrow key Down)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_left&lt;br /&gt;
| '''arrow_l''' || ''(Arrow key Left)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_right&lt;br /&gt;
| '''arrow_r''' || ''(Arrow key Right)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_downwards&lt;br /&gt;
| '''pgdn''' || ''(Page Down)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_upwards&lt;br /&gt;
| '''pgup''' || ''(Page Up)''&lt;br /&gt;
|-&lt;br /&gt;
| zoom_in&lt;br /&gt;
| '''mouse_wheel_down'''&lt;br /&gt;
|-&lt;br /&gt;
| zoom_out&lt;br /&gt;
| '''mouse_wheel_up'''&lt;br /&gt;
|-&lt;br /&gt;
| quick_rotate_increase&lt;br /&gt;
| '''mod_rotate''' + '''mouse_wheel_up''' || ''(Left CTRL + Mouse wheel Up)''&lt;br /&gt;
|-&lt;br /&gt;
| quick_rotate_decrease&lt;br /&gt;
| '''mod_rotate''' + '''mouse_wheel_down''' || ''(Left CTRL + Mouse wheel Down)''&lt;br /&gt;
|-&lt;br /&gt;
| mod_rotate&lt;br /&gt;
| '''lctrl''' || ''(Left CTRL)''&lt;br /&gt;
|-&lt;br /&gt;
| mod_slow_speed&lt;br /&gt;
| '''lalt''' || ''(Left ALT)''&lt;br /&gt;
|-&lt;br /&gt;
| mod_fast_speed&lt;br /&gt;
| '''lshift''' || ''(Left SHIFT)''&lt;br /&gt;
|-&lt;br /&gt;
| destroy_selected_element&lt;br /&gt;
| '''delete'''&lt;br /&gt;
|-&lt;br /&gt;
| drop_selected_element&lt;br /&gt;
| '''space'''&lt;br /&gt;
|-&lt;br /&gt;
| pickup_selected_element&lt;br /&gt;
| '''F2'''&lt;br /&gt;
|-&lt;br /&gt;
| reset_rotation&lt;br /&gt;
| '''mod_rotate''' + '''r''' || ''(Left CTRL + R)''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===GUI===&lt;br /&gt;
{|&lt;br /&gt;
| toggle_gui_display&lt;br /&gt;
| '''F4'''&lt;br /&gt;
|-&lt;br /&gt;
| toggle_cursor&lt;br /&gt;
| '''f'''&lt;br /&gt;
|-&lt;br /&gt;
| select_target_keyboard&lt;br /&gt;
| '''mouse1''' || ''(Left Mouse button)''&lt;br /&gt;
|-&lt;br /&gt;
| select_target_mouse&lt;br /&gt;
| '''mouse2''' || ''(Right Mouse button)''&lt;br /&gt;
|-&lt;br /&gt;
| edf_next&lt;br /&gt;
| '''mouse_wheel_up'''&lt;br /&gt;
|-&lt;br /&gt;
| edf_prev&lt;br /&gt;
| '''mouse_wheel_down'''&lt;br /&gt;
|-&lt;br /&gt;
| Отменить&lt;br /&gt;
| '''Ctrl''' + '''z'''&lt;br /&gt;
|-&lt;br /&gt;
| Вернуть&lt;br /&gt;
| '''Ctrl''' + '''y'''&lt;br /&gt;
|-&lt;br /&gt;
| properties_toggle&lt;br /&gt;
| '''F3'''&lt;br /&gt;
|-&lt;br /&gt;
| browser_up&lt;br /&gt;
| '''arrow_u''' || ''(Arrow key Up)''&lt;br /&gt;
|-&lt;br /&gt;
| browser_down&lt;br /&gt;
| '''arrow_d''' || ''(Arrow key Down)''&lt;br /&gt;
|-&lt;br /&gt;
| browser_zoom_in&lt;br /&gt;
| '''mouse_wheel_up'''&lt;br /&gt;
|-&lt;br /&gt;
| browser_zoom_out&lt;br /&gt;
| '''mouse_wheel_down'''&lt;br /&gt;
|-&lt;br /&gt;
| browser_confirm&lt;br /&gt;
| '''enter'''&lt;br /&gt;
|-&lt;br /&gt;
| currentelements_up&lt;br /&gt;
| '''num_8''' || ''(Numpad key 8)''&lt;br /&gt;
|-&lt;br /&gt;
| currentelements_down&lt;br /&gt;
| '''num_2''' || ''(Numpad key 2)''&lt;br /&gt;
|-&lt;br /&gt;
| toggle_test&lt;br /&gt;
| '''F5'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Мультиплеер==&lt;br /&gt;
The editor is built with both serverside and clientside components, and therefore supports multiplayer out of the box.  To use the editor in multiplayer with other players, simply copy all of the editor's resources into your server, start the '''editor''' resource and allow other players to join.&lt;br /&gt;
&lt;br /&gt;
Please note that currently the editor lacks any permissions system, ao all users have access to every function.&lt;br /&gt;
&lt;br /&gt;
==Плагины и внешние ресурсы==&lt;br /&gt;
{{Main|Resource:Editor/Plugins}}&lt;br /&gt;
&lt;br /&gt;
The editor allows basic importing of elements from external resources.  This is useful for resources that may have to manipulate an element in a specific way that cannot be performed by the editor.  For example, a map resource which uses custom models (and has a script to import these models) cannot be manipulated by default within the editor.  &lt;br /&gt;
&lt;br /&gt;
By using the '''import &amp;lt;resourceName&amp;gt;''' command in console the resource's elements can be imported within the editor.&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
==== I get an &amp;quot;Could not start the local server. See console for details&amp;quot; when using the  &amp;quot;Map Editor&amp;quot; button====&lt;br /&gt;
This is because you do not have a valid editor.conf installed.  You can download the default one [http://multitheftauto.googlecode.com/svn/trunk/MTA10_Server/mods/deathmatch/editor.conf here].  It should be placed in '''server/mods/deathmatch/''' in your MTA: San Andreas installation directory.&lt;br /&gt;
&lt;br /&gt;
==== I have saved a map but cannot find it in my server's resources directory, despite the Editor itself being able to see it ====&lt;br /&gt;
This is due to the fact that Vista limits write-access for non-admin processes in Program Files directory. Files get written in the &amp;quot;VirtualStore&amp;quot; dir instead of real Program Files folder.  You should be able to locate your map resource in a similar directory to:&lt;br /&gt;
 C:\Users\&amp;lt;USERNAME&amp;gt;\AppData\Local\VirtualStore\Program Files\MTA San Andreas\server\mods\deathmatch\resources\&lt;br /&gt;
&lt;br /&gt;
Running the Server/MTA San Andreas with Administrative rights will allow the map to be saved to the proper location.&lt;br /&gt;
&lt;br /&gt;
==== I have found a bug or have a suggestion/feedback for the map editor ====&lt;br /&gt;
Please use the official [http://bugs.mtasa.com bugtracker] for reporting bugs.  Feel free to also join us on [http://mtasa.com/irc.html IRC].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Insert non-formatted text here&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Dakilla&amp;diff=21827</id>
		<title>User:Dakilla</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Dakilla&amp;diff=21827"/>
		<updated>2009-11-03T20:39:59Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: Created page with 'Got any questions? Skype me: daki-boy.  I don't know what to write here :P so i'll leave this place all white...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Got any questions? Skype me: daki-boy.&lt;br /&gt;
&lt;br /&gt;
I don't know what to write here :P so i'll leave this place all white...&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnMarkerHit&amp;diff=21826</id>
		<title>OnMarkerHit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnMarkerHit&amp;diff=21826"/>
		<updated>2009-11-03T20:38:10Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when an element enters a marker created using [[createMarker]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player hitElement, bool matchingDimension&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''hitElement''': The element that hit the marker&lt;br /&gt;
*'''matchingDimension''': True if the element is in the same dimension as the marker he hit&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[marker]] that got hit by the element.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This example will output a message what type of element has entered a marker.&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 )&lt;br /&gt;
&lt;br /&gt;
function MarkerHit( hitElement, matchingDimension )&lt;br /&gt;
        if getElementType( hitElement ) == &amp;quot;player&amp;quot; then&lt;br /&gt;
          outputChatBox( &amp;quot;Player inside myMarker&amp;quot;, getRootElement(), 255, 255, 0 )&lt;br /&gt;
        elseif getElementType( hitElement ) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
	  outputChatBox( &amp;quot;Vehicle inside  myMarker&amp;quot;, getRootElement(), 255, 255, 0 )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onMarkerHit&amp;quot;, myMarker, MarkerHit )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Marker events}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnMarkerLeave&amp;diff=21825</id>
		<title>OnMarkerLeave</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnMarkerLeave&amp;diff=21825"/>
		<updated>2009-11-03T20:36:57Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: Minor changes + example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when an element leaves the area of a marker created using [[createMarker]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player leftElement, bool matchingDimension&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''leftPlayer''': The element that left the marker's area&lt;br /&gt;
*'''matchingDimension''': True if the element is in the same dimension as the marker he left&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[marker]] that the player left.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example shows a message in the chat box when element (in this case a player) leaves a marker.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, &amp;quot;cylinder&amp;quot;, 2.0, 255, 0, 0, 150 )&lt;br /&gt;
&lt;br /&gt;
function markerLeave( leaveElement, matchingDimension )&lt;br /&gt;
        if getElementType( leaveElement ) == &amp;quot;player&amp;quot; then&lt;br /&gt;
          outputChatBox ( &amp;quot;Player has left a marker&amp;quot;, getRootElement(), 255, 255, 0 )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onMarkerLeave&amp;quot;, myMarker, markerLeave )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Marker events}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnMarkerHit&amp;diff=21824</id>
		<title>OnMarkerHit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnMarkerHit&amp;diff=21824"/>
		<updated>2009-11-03T20:32:20Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when an element enters a marker created using [[createMarker]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player hitElement, bool matchingDimension&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''hitElement''': The element that hit the marker&lt;br /&gt;
*'''matchingDimension''': True if the element is in the same dimension as the marker he hit&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[marker]] that got hit by the element.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This will output 'hi' in the chatbox when the marker is hit.&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 )&lt;br /&gt;
&lt;br /&gt;
function MarkerHit( hitElement, matchingDimension )&lt;br /&gt;
        if getElementType( hitElement ) == &amp;quot;player&amp;quot; then&lt;br /&gt;
          outputChatBox( &amp;quot;Player inside myMarker&amp;quot;, getRootElement(), 255, 255, 0 )&lt;br /&gt;
        elseif getElementType( hitElement ) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
	  outputChatBox( &amp;quot;Vehicle inside  myMarker&amp;quot;, getRootElement(), 255, 255, 0 )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onMarkerHit&amp;quot;, myMarker, MarkerHit )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Marker events}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnMarkerHit&amp;diff=21823</id>
		<title>OnMarkerHit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnMarkerHit&amp;diff=21823"/>
		<updated>2009-11-03T20:31:47Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: Minor changes + 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 player enters a marker created using [[createMarker]].&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player hitElement, bool matchingDimension&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''hitElement''': The element that hit the marker&lt;br /&gt;
*'''matchingDimension''': True if the element is in the same dimension as the marker he hit&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[marker]] that got hit by the element.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This will output 'hi' in the chatbox when the marker is hit.&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 )&lt;br /&gt;
&lt;br /&gt;
function MarkerHit( hitElement, matchingDimension )&lt;br /&gt;
        if getElementType( hitElement ) == &amp;quot;player&amp;quot; then&lt;br /&gt;
          outputChatBox( &amp;quot;Player inside myMarker&amp;quot;, getRootElement(), 255, 255, 0 )&lt;br /&gt;
        elseif getElementType( hitElement ) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
	  outputChatBox( &amp;quot;Vehicle inside  myMarker&amp;quot;, getRootElement(), 255, 255, 0 )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onMarkerHit&amp;quot;, myMarker, MarkerHit )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Marker events}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerWasted&amp;diff=21822</id>
		<title>OnPlayerWasted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWasted&amp;diff=21822"/>
		<updated>2009-10-30T15:32:48Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example: fixed a typo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player is killed or dies.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
{{New feature|3|1.0|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int totalAmmo, element killer, int killerWeapon, int bodypart [, bool stealth ]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int totalAmmo, element killer, int killerWeapon, int bodypart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
*'''totalAmmo''': an integer representing the total ammo the victim had when he died.&lt;br /&gt;
*'''killer''': an [[element]] representing the player or vehicle who was the killer.  If there was no killer this is ''false''.&lt;br /&gt;
*'''killerWeapon''': an integer representing the [[weapon]] the killer used to kill the player.&lt;br /&gt;
*'''bodypart''': an integer representing the bodypart ID the victim was hit on when he died.&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
*{{New feature|3|1.0|'''stealth''': boolean value representing whether or not this was a stealth kill}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that died or got killed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example prints the killer and bodypart to the chat when a player dies.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- register player_Wasted as a handler for onPlayerWasted&lt;br /&gt;
function player_Wasted ( ammo, attacker, weapon, bodypart )&lt;br /&gt;
	-- if there was an attacker&lt;br /&gt;
	if ( attacker ) then&lt;br /&gt;
		-- we declare our variable outside the following checks&lt;br /&gt;
		local tempString&lt;br /&gt;
		-- if the element that killed him was a player,&lt;br /&gt;
		if ( getElementType ( attacker ) == &amp;quot;player&amp;quot; ) then&lt;br /&gt;
			-- put the attacker, victim and weapon info in the string&lt;br /&gt;
			tempString = getPlayerName ( attacker )..&amp;quot; killed &amp;quot;..getPlayerName ( source )..&amp;quot; (&amp;quot;..getWeaponNameFromID ( weapon )..&amp;quot;)&amp;quot;&lt;br /&gt;
		-- else, if it was a vehicle,&lt;br /&gt;
		elseif ( getElementType ( attacker ) == &amp;quot;vehicle&amp;quot; ) then&lt;br /&gt;
			-- we'll get the name from the attacker vehicle's driver&lt;br /&gt;
			local tempString = getPlayerName ( getVehicleController ( attacker ) )..&amp;quot; killed &amp;quot;..getPlayerName ( source )..&amp;quot; (&amp;quot;..getWeaponNameFromID ( weapon )..&amp;quot;)&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		-- if the victim was shot in the head, append a special message&lt;br /&gt;
		if ( bodypart == 9 ) then&lt;br /&gt;
			tempString = tempString..&amp;quot; (HEADSHOT!)&amp;quot;&lt;br /&gt;
		-- else, just append the bodypart name&lt;br /&gt;
		else&lt;br /&gt;
			tempString = tempString..&amp;quot; (&amp;quot;..getBodyPartName ( bodypart )..&amp;quot;)&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		-- display the message&lt;br /&gt;
		outputChatBox ( tempString )&lt;br /&gt;
	-- if there was no attacker,&lt;br /&gt;
	else&lt;br /&gt;
		-- output a death message without attacker info&lt;br /&gt;
		outputChatBox ( getPlayerName ( source )..&amp;quot; died. (&amp;quot;..getWeaponNameFromID ( weapon )..&amp;quot;) (&amp;quot;..getBodyPartName ( bodypart )..&amp;quot;)&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWasted&amp;quot;, getRootElement(), player_Wasted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And another example, this will spawn you in the middle of GTA SA world (x=0, y=0, z=3) after 2 seconds of your death&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerWasted&amp;quot;, getRootElement( ),&lt;br /&gt;
	function()&lt;br /&gt;
		setTimer( spawnPlayer, 2000, 1, source, 0, 0, 3 )&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Dakilla</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleName&amp;diff=21787</id>
		<title>GetVehicleName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleName&amp;diff=21787"/>
		<updated>2009-10-25T15:03:18Z</updated>

		<summary type="html">&lt;p&gt;Dakilla: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns a string containing the name of the vehicle&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getVehicleName ( vehicle theVehicle )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you want to get the name of. &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the requested vehicle's name, or ''false'' if the vehicle passed to the function is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example checks whether a player enters an AT-400 or a Shamal.  If they do, it announces it to the chat specifying what vehicle was stolen.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function planeEnter ( theVehicle, seat, jacked ) -- when someone enters a vehicle&lt;br /&gt;
    local id = getVehicleID ( theVehicle ) -- get the model ID of the vehicle&lt;br /&gt;
    if id == 519 or id == 577 then -- if theVehicle is either Shamal or AT-400&lt;br /&gt;
        local vehicleName = getVehicleName ( theVehicle ) -- get the name of theVehicle&lt;br /&gt;
        outputChatBox ( &amp;quot;Someone has stolen a &amp;quot; .. vehicleName .. &amp;quot;!&amp;quot; ) -- announce that someone has stolen the plane&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add the event handler to the event&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerVehicleEnter&amp;quot;, getRootElement(), planeEnter )&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>Dakilla</name></author>
	</entry>
</feed>