PlayerLeaveVehicle: Difference between revisions
No edit summary |
MrPancakers2 (talk | contribs) m (Added parameters to JS syntax) |
||
| Line 25: | Line 25: | ||
{{JSContainer| | {{JSContainer| | ||
=== Parameters === | |||
*'''vehicle''': {{RageType|Object}} | |||
*'''seat''': {{RageType|Int}} | |||
{{Example}} | {{Example}} | ||
This example outputs chat message | This example outputs a chat message when the player start's to leave from the car and their seat ID. | ||
{{ClientsideCode| | |||
<pre> | <pre> | ||
mp.events.add("playerLeaveVehicle", () => { | mp.events.add("playerLeaveVehicle", (vehicle, seat) => { | ||
mp.gui.chat.push( | mp.gui.chat.push(`You are now leaving the vehicle from seat ${seat}`); | ||
}) | }) | ||
</pre> | </pre> | ||
}} | |||
}} | }} | ||
Revision as of 23:32, 20 April 2020
Triggers when the player exits the vehicle.
Client-Side Event
C# Syntax
public delegate void OnPlayerLeaveVehicleDelegate();
Parameters
This event has no parameters
Example
The example below send a chat message to the player when they exit a vehicle.
Events.OnPlayerLeaveVehicle += OnPlayerLeaveVehicle();
public void OnPlayerLeaveVehicle()
{
RAGE.Chat.Output("You exited a vehicle");
}
JavaScript Syntax
Parameters
- vehicle: Object
- seat: Int
Example
This example outputs a chat message when the player start's to leave from the car and their seat ID.
Client-Side
mp.events.add("playerLeaveVehicle", (vehicle, seat) => {
mp.gui.chat.push(`You are now leaving the vehicle from seat ${seat}`);
})
See Also
Checkpoint
Colshape
Entity
Player
- playerChat
- playerCommand
- playerDamage
- playerDeath
- playerJoin
- playerQuit
- playerReady
- playerSpawn
- playerWeaponChange
Streaming
Vehicle
- playerStartEnterVehicle
- playerEnterVehicle
- playerStartExitVehicle
- playerExitVehicle
- trailerAttached
- vehicleDamage
- vehicleDeath
- vehicleHornToggle
- vehicleSirenToggle