<?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=ThomasNightfire</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=ThomasNightfire"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/ThomasNightfire"/>
	<updated>2026-05-19T07:38:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67902</id>
		<title>SetPedEnterVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67902"/>
		<updated>2020-12-04T22:20:59Z</updated>

		<summary type="html">&lt;p&gt;ThomasNightfire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20740|This function makes a [[ped]] enter a [[vehicle]], similar to the enter_exit control state.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|For this function to work on peds, the server and all clients are required to be on version '''1.5.8 r20740''' or newer.}}&lt;br /&gt;
{{Note|This function only works on synced peds and vehicles (ie. created serverside).}}&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 setPedEnterVehicle ( ped thePed [, vehicle = nil, passenger = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[player]] or [[ped]] to enter the vehicle.&lt;br /&gt;
**''Note: The player must be the local player.''&lt;br /&gt;
**''Note: The ped must be synced by the client. Use [[isElementSyncer]] clientside to check if the client is syncing. Use [[setElementSyncer]] serverside to change the syncer manually.''&lt;br /&gt;
*'''vehicle:''' The [[vehicle]] to enter. If no vehicle is set, the ped will enter the nearest vehicle within 20 m.&lt;br /&gt;
*'''passenger:''' If set to ''true'', the ped will enter as passenger in the nearest available seat, otherwise he will enter as driver.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
When this function returns ''true'', the client will ask server for permission to enter a vehicle. Actually entering can still fail in the following cases&lt;br /&gt;
*The function is used on a ped, but another client is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Another player or ped is already entering, exiting or jacking the same vehicle and seat.&lt;br /&gt;
*Movement input or damage can interrupt the task. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
This function returns ''false'' in the following cases&lt;br /&gt;
*Invalid arguments were parsed.&lt;br /&gt;
*The function is used on a ped, but the server is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Time passed since last enter/exit for this ped is less than 1500 ms.&lt;br /&gt;
*[[onClientVehicleStartEnter]] was cancelled by a script.&lt;br /&gt;
*The ped has an active TASK_PRIMARY [[task]]. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Make ped Sweet enter his car&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 sweet = createPed(270, 0, 0, 3)&lt;br /&gt;
setElementID(sweet , 'sweet')&lt;br /&gt;
&lt;br /&gt;
local sweets_car = createVehicle(492, 3, 0, 3)&lt;br /&gt;
setElementID(sweets_car, 'sweets_car')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
-- Code works only if client is syncing ped Sweet&lt;br /&gt;
addCommandHandler('sweet_enter_car',&lt;br /&gt;
function()&lt;br /&gt;
    local sweet = getElementByID('sweet')&lt;br /&gt;
&lt;br /&gt;
    if isElementSyncer(sweet) then&lt;br /&gt;
        setPedEnterVehicle(sweet, getElementByID('sweets_car'), true)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>ThomasNightfire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67901</id>
		<title>SetPedEnterVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67901"/>
		<updated>2020-12-04T22:20:38Z</updated>

		<summary type="html">&lt;p&gt;ThomasNightfire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20740|This function makes a [[ped]] enter a [[vehicle]], similar to the enter_exit control state.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|For this function to work on peds, the server and all clients are required to be on version '''1.5.8 r20740''' or newer.}}&lt;br /&gt;
{{Note|This function only works on synced peds and vehicles (ie. created serverside).}}&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 setPedEnterVehicle ( ped thePed [, vehicle = nil, passenger = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[player]] or [[ped]] to enter the vehicle.&lt;br /&gt;
**''Note: The player must be the local player.''&lt;br /&gt;
**''Note: The ped must be synced by the client. Use [[isElementSyncer]] clientside to check if the client is syncing. Use [[setElementSyncer]] serverside to change the syncer manually.''&lt;br /&gt;
*'''vehicle:''' The [[vehicle]] to enter. If no vehicle is set, the ped will enter the nearest vehicle within 20 m.&lt;br /&gt;
*'''passenger:''' If set to ''true'', the ped will enter as passenger in the nearest available seat, otherwise he will enter as driver.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
When this function returns ''true'', the client will ask server for permission to enter a vehicle. Actually entering can still fail in the following cases&lt;br /&gt;
*The function is used on a ped, but another client is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Another player or ped is already entering, exiting or jacking the same vehicle and seat.&lt;br /&gt;
*Movement input or damage can interrupt the task. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
This function returns ''false'' in the following cases&lt;br /&gt;
*Invalid arguments were parsed.&lt;br /&gt;
*The function is used on a ped, but the server is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Time passed since last enter/exit for this ped is less than 1500 ms.&lt;br /&gt;
*[[onClientVehicleStartEnter]] was cancelled by a script.&lt;br /&gt;
*The ped has an active TASK_PRIMARY [[task]]. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Make ped Sweet enter his car&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 sweet = createPed(270, 0, 0, 3)&lt;br /&gt;
setElementID(sweet , 'sweet')&lt;br /&gt;
&lt;br /&gt;
local sweets_car = createVehicle(492, 3, 0, 3)&lt;br /&gt;
setElementID(sweets_car, 'sweets_car')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
-- Code works only if client is syncing ped Sweet&lt;br /&gt;
addCommandHandler('sweet_enter_car',&lt;br /&gt;
function()&lt;br /&gt;
    local sweet = getElementByID('sweet')&lt;br /&gt;
&lt;br /&gt;
    if isElementSyncer(sweet) then&lt;br /&gt;
        setPedEnterVehicle(getElementByID('sweet'), getElementByID('sweets_car'), true)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>ThomasNightfire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67900</id>
		<title>SetPedEnterVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67900"/>
		<updated>2020-12-04T22:20:11Z</updated>

		<summary type="html">&lt;p&gt;ThomasNightfire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20740|This function makes a [[ped]] enter a [[vehicle]], similar to the enter_exit control state.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|For this function to work on peds, the server and all clients are required to be on version '''1.5.8 r20740''' or newer.}}&lt;br /&gt;
{{Note|This function only works on synced peds and vehicles (ie. created serverside).}}&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 setPedEnterVehicle ( ped thePed [, vehicle = nil, passenger = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[player]] or [[ped]] to enter the vehicle.&lt;br /&gt;
**''Note: The player must be the local player.''&lt;br /&gt;
**''Note: The ped must be synced by the client. Use [[isElementSyncer]] clientside to check if the client is syncing. Use [[setElementSyncer]] serverside to change the syncer manually.''&lt;br /&gt;
*'''vehicle:''' The [[vehicle]] to enter. If no vehicle is set, the ped will enter the nearest vehicle within 20 m.&lt;br /&gt;
*'''passenger:''' If set to ''true'', the ped will enter as passenger in the nearest available seat, otherwise he will enter as driver.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
When this function returns ''true'', the client will ask server for permission to enter a vehicle. Actually entering can still fail in the following cases&lt;br /&gt;
*The function is used on a ped, but another client is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Another player or ped is already entering, exiting or jacking the same vehicle and seat.&lt;br /&gt;
*Movement input or damage can interrupt the task. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
This function returns ''false'' in the following cases&lt;br /&gt;
*Invalid arguments were parsed.&lt;br /&gt;
*The function is used on a ped, but the server is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Time passed since last enter/exit for this ped is less than 1500 ms.&lt;br /&gt;
*[[onClientVehicleStartEnter]] was cancelled by a script.&lt;br /&gt;
*The ped has an active TASK_PRIMARY [[task]]. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Make ped Sweet enter his car&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 sweet = createPed(270, 0, 0, 3)&lt;br /&gt;
setElementID(sweet , 'sweet')&lt;br /&gt;
&lt;br /&gt;
local sweets_car = createVehicle(492, 3, 0, 3)&lt;br /&gt;
setElementID(sweets_car, 'sweets_car')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
-- Code will work only if client is syncing Sweet&lt;br /&gt;
addCommandHandler('sweet_enter_car',&lt;br /&gt;
function()&lt;br /&gt;
    local sweet = getElementByID('sweet')&lt;br /&gt;
&lt;br /&gt;
    if isElementSyncer(sweet) then&lt;br /&gt;
        setPedEnterVehicle(getElementByID('sweet'), getElementByID('sweets_car'), true)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>ThomasNightfire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67899</id>
		<title>SetPedEnterVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67899"/>
		<updated>2020-12-04T22:17:57Z</updated>

		<summary type="html">&lt;p&gt;ThomasNightfire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20740|This function makes a [[ped]] enter a [[vehicle]], similar to the enter_exit control state.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|For this function to work on peds, the server and all clients are required to be on version '''1.5.8 r20740''' or newer.}}&lt;br /&gt;
{{Note|This function only works on synced peds and vehicles (ie. created serverside).}}&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 setPedEnterVehicle ( ped thePed [, vehicle = nil, passenger = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[player]] or [[ped]] to enter the vehicle.&lt;br /&gt;
**''Note: The player must be the local player.''&lt;br /&gt;
**''Note: The ped must be synced by the client. Use [[isElementSyncer]] clientside to check if the client is syncing. Use [[setElementSyncer]] serverside to change the syncer manually.''&lt;br /&gt;
*'''vehicle:''' The [[vehicle]] to enter. If no vehicle is set, the ped will enter the nearest vehicle within 20 m.&lt;br /&gt;
*'''passenger:''' If set to ''true'', the ped will enter as passenger in the nearest available seat, otherwise he will enter as driver.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
When this function returns ''true'', the client will ask server for permission to enter a vehicle. Actually entering can still fail in the following cases&lt;br /&gt;
*The function is used on a ped, but another client is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Another player or ped is already entering, exiting or jacking the same vehicle and seat.&lt;br /&gt;
*Movement input or damage can interrupt the task. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
This function returns ''false'' in the following cases&lt;br /&gt;
*Invalid arguments were parsed.&lt;br /&gt;
*The function is used on a ped, but the server is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Time passed since last enter/exit for this ped is less than 1500 ms.&lt;br /&gt;
*[[onClientVehicleStartEnter]] was cancelled by a script.&lt;br /&gt;
*The ped has an active TASK_PRIMARY [[task]]. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Make ped Sweet enter his car&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 sweet = createPed(270, 0, 0, 3)&lt;br /&gt;
setElementID(sweet , 'sweet')&lt;br /&gt;
&lt;br /&gt;
local sweets_car = createVehicle(492, 3, 0, 3)&lt;br /&gt;
setElementID(sweets_car, 'sweets_car')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
addCommandHandler('sweet_enter_car',&lt;br /&gt;
function()&lt;br /&gt;
    setPedEnterVehicle(getElementByID('sweet'), getElementByID('sweets_car'), true)&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;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>ThomasNightfire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67898</id>
		<title>SetPedEnterVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67898"/>
		<updated>2020-12-04T22:17:31Z</updated>

		<summary type="html">&lt;p&gt;ThomasNightfire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20740|This function makes a [[ped]] enter a [[vehicle]], similar to the enter_exit control state.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|For this function to work on peds, the server and all clients are required to be on version '''1.5.8 r20740''' or newer.}}&lt;br /&gt;
{{Note|This function only works on synced peds and vehicles (ie. created serverside).}}&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 setPedEnterVehicle ( ped thePed [, vehicle = nil, passenger = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[player]] or [[ped]] to enter the vehicle.&lt;br /&gt;
**''Note: The player must be the local player.''&lt;br /&gt;
**''Note: The ped must be synced by the client. Use [[isElementSyncer]] clientside to check if the client is syncing. Use [[setElementSyncer]] serverside to change the syncer manually.''&lt;br /&gt;
*'''vehicle:''' The [[vehicle]] to enter. If no vehicle is set, the ped will enter the nearest vehicle within 20 m.&lt;br /&gt;
*'''passenger:''' If set to ''true'', the ped will enter as passenger in the nearest available seat, otherwise he will enter as driver.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
When this function returns ''true'', the client will ask server for permission to enter a vehicle. Actually entering can still fail in the following cases&lt;br /&gt;
*The function is used on a ped, but another client is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Another player or ped is already entering, exiting or jacking the same vehicle and seat.&lt;br /&gt;
*Movement input or damage can interrupt the task. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
This function returns ''false'' in the following cases&lt;br /&gt;
*Invalid arguments were parsed.&lt;br /&gt;
*The function is used on a ped, but the server is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Time passed since last enter/exit for this ped is less than 1500 ms.&lt;br /&gt;
*[[onClientVehicleStartEnter]] was cancelled by a script.&lt;br /&gt;
*The ped has an active TASK_PRIMARY [[task]]. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Make ped Sweet enter his car&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 sweet = createPed(270, 0, 0, 3)&lt;br /&gt;
setElementID(sweet , 'sweet')&lt;br /&gt;
&lt;br /&gt;
local sweets_car = createVehicle(492, 3, 0, 3)&lt;br /&gt;
setElementID(sweets_car, 'sweets_car')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
addCommandHandler('ped_enter_veh',&lt;br /&gt;
function()&lt;br /&gt;
    setPedEnterVehicle(getElementByID('sweet'), getElementByID('sweets_car'), true)&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;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>ThomasNightfire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67897</id>
		<title>SetPedEnterVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67897"/>
		<updated>2020-12-04T22:17:15Z</updated>

		<summary type="html">&lt;p&gt;ThomasNightfire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20740|This function makes a [[ped]] enter a [[vehicle]], similar to the enter_exit control state.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|For this function to work on peds, the server and all clients are required to be on version '''1.5.8 r20740''' or newer.}}&lt;br /&gt;
{{Note|This function only works on synced peds and vehicles (ie. created serverside).}}&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 setPedEnterVehicle ( ped thePed [, vehicle = nil, passenger = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[player]] or [[ped]] to enter the vehicle.&lt;br /&gt;
**''Note: The player must be the local player.''&lt;br /&gt;
**''Note: The ped must be synced by the client. Use [[isElementSyncer]] clientside to check if the client is syncing. Use [[setElementSyncer]] serverside to change the syncer manually.''&lt;br /&gt;
*'''vehicle:''' The [[vehicle]] to enter. If no vehicle is set, the ped will enter the nearest vehicle within 20 m.&lt;br /&gt;
*'''passenger:''' If set to ''true'', the ped will enter as passenger in the nearest available seat, otherwise he will enter as driver.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
When this function returns ''true'', the client will ask server for permission to enter a vehicle. Actually entering can still fail in the following cases&lt;br /&gt;
*The function is used on a ped, but another client is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Another player or ped is already entering, exiting or jacking the same vehicle and seat.&lt;br /&gt;
*Movement input or damage can interrupt the task. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
This function returns ''false'' in the following cases&lt;br /&gt;
*Invalid arguments were parsed.&lt;br /&gt;
*The function is used on a ped, but the server is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Time passed since last enter/exit for this ped is less than 1500 ms.&lt;br /&gt;
*[[onClientVehicleStartEnter]] was cancelled by a script.&lt;br /&gt;
*The ped has an active TASK_PRIMARY [[task]]. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Make Sweet enter his car&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 sweet = createPed(270, 0, 0, 3)&lt;br /&gt;
setElementID(sweet , 'sweet')&lt;br /&gt;
&lt;br /&gt;
local sweets_car = createVehicle(492, 3, 0, 3)&lt;br /&gt;
setElementID(sweets_car, 'sweets_car')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
addCommandHandler('ped_enter_veh',&lt;br /&gt;
function()&lt;br /&gt;
    setPedEnterVehicle(getElementByID('sweet'), getElementByID('sweets_car'), true)&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;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>ThomasNightfire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67896</id>
		<title>SetPedEnterVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedEnterVehicle&amp;diff=67896"/>
		<updated>2020-12-04T22:16:59Z</updated>

		<summary type="html">&lt;p&gt;ThomasNightfire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20740|This function makes a [[ped]] enter a [[vehicle]], similar to the enter_exit control state.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|For this function to work on peds, the server and all clients are required to be on version '''1.5.8 r20740''' or newer.}}&lt;br /&gt;
{{Note|This function only works on synced peds and vehicles (ie. created serverside).}}&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 setPedEnterVehicle ( ped thePed [, vehicle = nil, passenger = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The [[player]] or [[ped]] to enter the vehicle.&lt;br /&gt;
**''Note: The player must be the local player.''&lt;br /&gt;
**''Note: The ped must be synced by the client. Use [[isElementSyncer]] clientside to check if the client is syncing. Use [[setElementSyncer]] serverside to change the syncer manually.''&lt;br /&gt;
*'''vehicle:''' The [[vehicle]] to enter. If no vehicle is set, the ped will enter the nearest vehicle within 20 m.&lt;br /&gt;
*'''passenger:''' If set to ''true'', the ped will enter as passenger in the nearest available seat, otherwise he will enter as driver.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
When this function returns ''true'', the client will ask server for permission to enter a vehicle. Actually entering can still fail in the following cases&lt;br /&gt;
*The function is used on a ped, but another client is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Another player or ped is already entering, exiting or jacking the same vehicle and seat.&lt;br /&gt;
*Movement input or damage can interrupt the task. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
This function returns ''false'' in the following cases&lt;br /&gt;
*Invalid arguments were parsed.&lt;br /&gt;
*The function is used on a ped, but the server is not on version '''1.5.8 r20740''' or newer.&lt;br /&gt;
*Time passed since last enter/exit for this ped is less than 1500 ms.&lt;br /&gt;
*[[onClientVehicleStartEnter]] was cancelled by a script.&lt;br /&gt;
*The ped has an active TASK_PRIMARY [[task]]. Use [[getPedTask]] to monitor what the ped is doing.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Makes Sweet enter his car&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 sweet = createPed(270, 0, 0, 3)&lt;br /&gt;
setElementID(sweet , 'sweet')&lt;br /&gt;
&lt;br /&gt;
local sweets_car = createVehicle(492, 3, 0, 3)&lt;br /&gt;
setElementID(sweets_car, 'sweets_car')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
addCommandHandler('ped_enter_veh',&lt;br /&gt;
function()&lt;br /&gt;
    setPedEnterVehicle(getElementByID('sweet'), getElementByID('sweets_car'), true)&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;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>ThomasNightfire</name></author>
	</entry>
</feed>