onPlayerEnteringVehicle

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 begins entering a vehicle.

Syntax

  1. function onPlayerEnteringVehicle( Player player, Vehicle vehicle, int door )

Arguments

  • player - The player who is entering a vehicle
  • vehicle - The vehicle the player is entering
  • door - The door which the player is using to enter the vehicle

Returns

  • 1 - Allows the player to enter the vehicle normally
  • 0 - Stops the player from entering the vehicle

Example

This example will stop the player from entering the vehicle.

  1.  
  2. function onPlayerEnteringVehicle( player, vehicle, door )
  3. {
  4. MessagePlayer( "Bet you would like to enter that vehicle!", player );
  5. return 0;
  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