Scripting/Squirrel/Events/Vehicle/onPlayerEnterVehicle

From VC-MP Wiki

Jump to: navigation, search

This is called when a player starts entering a vehicle.

Syntax

function onPlayerEnterVehicle( player, vehicle, isPassenger )

Parameters

  • player - The object representing the player who is entering the vehicle
  • vehicle - The vehicle object the player is entering
  • isPassenger - A boolean which tells whether the player is entering the vehicle as a passenger

Example

This example will tell player the name of the vehicle they are entering.

function onPlayerEnterVehicle( player, vehicle, isPassenger )
{
     MessagePlayer( "You are entering a " + vehicle + ".", player );
}

Notes

The function MessagePlayer was used in in this example. More info about it in the corresponding page.

Related Events

Personal tools
squirrel scripting