Garry's Mod Wiki

GM:CanPlayerEnterVehicle

  boolean GM:CanPlayerEnterVehicle( Player player, Vehicle vehicle, number role )

Description

Determines whether or not a given player player can enter the given vehicle. Player:EnterVehicle will bypass this hook.

Called just before GM:PlayerEnteredVehicle.

Arguments

1 Player player
The player that wants to enter a vehicle.
2 Vehicle vehicle
The vehicle in question.
3 number role
The seat number.

Returns

1 boolean
false if the player is not allowed to enter the vehicle.