onPlayerEnteredVehicle

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This is called when a player has successfully entered a vehicle.

Syntax

  1. function onPlayerEnteredVehicle( Player player, Vehicle vehicle, int seat )

Arguments

  • player - The player entered a vehicle
  • vehicle - The vehicle the player entered
  • seat - The vehicle seat player is currently occupying
    • 0 - Driver
    • 1 - Front passenger
    • 2 - Back left passenger
    • 3 - Back right passenger
    • 4- - Other passenger seats (coach, bus)

Returns

This event does not handle return values.

Example

This example will message player the name of the vehicle they just entered.

  1.  
  2. function onPlayerEnteredVehicle( player, vehicle, seat )
  3. {
  4. MessagePlayer( "You entered a " + vehicle.tostring(), player );
  5. return 1;
  6. }
  7.  

Notes

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

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox