ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onVehicleStartEnter

Event

onVehicleStartEnter

A player starts getting into a vehicle (walks to the door). You can stop them, e.g. at a locked faction car.

Handler

addEventHandler("onVehicleStartEnter", root, function(enteringPlayer, seat, jacked) ... end)

Parameters

enteringPlayerplayer
The player.
seatint
Seat.
jackedplayer
The player to be jacked or false.

Differences from MTA:SA

  • These MTA:SA parameters are not here: int door

In MTA:SA

function(ped enteringPed, int seat, ped jacked, int door)

Source

source is the vehicle.

cancelEvent() leads the player away.

Example

addEventHandler("onVehicleStartEnter", root, function(player, seat)
    if seat == 0 and getElementData(source, "policja") and getElementData(player, "frakcja") ~= "policja" then
        cancelEvent()
        outputChatBox("To auto policji.", player, 255, 80, 80)
    end
end)

See also