<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.rage.mp/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mentanding</id>
	<title>RAGE Multiplayer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.rage.mp/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mentanding"/>
	<link rel="alternate" type="text/html" href="https://wiki.rage.mp/wiki/Special:Contributions/Mentanding"/>
	<updated>2026-07-18T20:12:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=PlayerEnterVehicle&amp;diff=18041</id>
		<title>PlayerEnterVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=PlayerEnterVehicle&amp;diff=18041"/>
		<updated>2019-08-19T00:49:19Z</updated>

		<summary type="html">&lt;p&gt;Mentanding: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This event is triggered when a player entered vehicle.&lt;br /&gt;
&lt;br /&gt;
{{ServersideCsJsEvent}}&lt;br /&gt;
&lt;br /&gt;
{{CSharpContainer|1=&lt;br /&gt;
See [https://wiki.gtanet.work/index.php?title=OnPlayerEnterVehicle on GTA Network Wiki].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
*&#039;&#039;&#039;Known issue&#039;&#039;&#039;: Client side this event is triggered when the player starts to enter the vehicle and not once they&#039;ve completely sat down. This also causes the seat parameter to return &#039;undefined&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Parameters}}&lt;br /&gt;
* &#039;&#039;&#039;player&#039;&#039;&#039;: {{RageType|Player}} - The [[:Category:Player API|player]] which entered vehicle.&lt;br /&gt;
* &#039;&#039;&#039;vehicle&#039;&#039;&#039;: {{RageType|Vehicle}} - The current [[:Category:Vehicle API|vehicle]] the player is sitting in.&lt;br /&gt;
* &#039;&#039;&#039;seat&#039;&#039;&#039;: {{RageType|Number}} - The seat ID the player sits down on.&lt;br /&gt;
&lt;br /&gt;
{{Example}}&lt;br /&gt;
This example outputs chat message, when player is in the car.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function playerEnterVehicleHandler(player, vehicle, seat) {&lt;br /&gt;
	mp.gui.chat.push(`${player.name} got into the car with ID: ${vehicle.id}. Seat: ${seat}`);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
mp.events.add(&amp;quot;playerEnterVehicle&amp;quot;, playerEnterVehicleHandler);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{ClientsideCsJsEvent}}&lt;br /&gt;
&lt;br /&gt;
{{CSharpContainer|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public delegate void OnPlayerEnterVehicleDelegate(Vehicle vehicle, int seatId);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Parameters}}&lt;br /&gt;
* &#039;&#039;&#039;vehicle&#039;&#039;&#039; - vehicle &#039;&#039;&#039;RAGE.Elements.Vehicle&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;seatId&#039;&#039;&#039; - the id of the seat, expects&#039;&#039;&#039;System.Int32&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Example}}&lt;br /&gt;
The example below sends a chat message to play when they enter a vehicle, showing whether they are driver or passenger.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
Events.OnPlayerEnterVehicle += OnPlayerEnterVehicle;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public void OnPlayerEnterVehicle(RAGE.Elements.Vehicle vehicle, int seatId, RAGE.Events.CancelEventArgs cancel)&lt;br /&gt;
{&lt;br /&gt;
    if (seatId == -1)&lt;br /&gt;
    {&lt;br /&gt;
        RAGE.Chat.Output(&amp;quot;You got in the driver&#039;s seat&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        RAGE.Chat.Output(&amp;quot;You got in a passenger seat&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
{{Parameters}}&lt;br /&gt;
* &#039;&#039;&#039;vehicle&#039;&#039;&#039;: {{RageType|Vehicle}} - The current [[:Category:Vehicle API|vehicle]] the player entered.&lt;br /&gt;
* &#039;&#039;&#039;seat&#039;&#039;&#039;: {{RageType|Number}} - The seat ID the player sits down on.&lt;br /&gt;
&lt;br /&gt;
{{Example}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function playerEnterVehicleHandler(vehicle, seat) {&lt;br /&gt;
   mp.gui.chat.push(`You got into the car with ID: ${vehicle.id}. Seat: ${seat}`);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
mp.events.add(&amp;quot;playerEnterVehicle&amp;quot;, playerEnterVehicleHandler);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Player_events}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Player]]&lt;br /&gt;
[[Category:Vehicle]]&lt;br /&gt;
[[Category:Server-side Event]]&lt;br /&gt;
[[Category:Client-side Event]]&lt;/div&gt;</summary>
		<author><name>Mentanding</name></author>
	</entry>
</feed>