OnPlayerStartEnterVehicle: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
Line 8: Line 8:


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua>
AddEvent("OnPlayerStartEnterVehicle", function(vehicleId, seatId)
    if seatId == 0 then
        print("Entered as a driver.")
    end
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
{{ClientEvents}}
{{Template:VehicleEvents}}

Revision as of 17:03, 13 December 2019

OnPlayerStartEnterVehicle

Type: Event
Context: Client
Introduced: v1.0

Description

Called when a player presses the key to start entering a vehicle. You can return false in this event to stop the player from entering.

Syntax

OnPlayerStartEnterVehicle(vehicle, seat)
  • vehicle
    The vehicle identifier.
  • seat
    The vehicle seat in which the player tries to get in.

Example

AddEvent("OnPlayerStartEnterVehicle", function(vehicleId, seatId)
    if seatId == 0 then
        print("Entered as a driver.")
    end
end)

See also