OnClientPlayerVehicleEnter: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Be more specific)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Client event}}
{{Client event}}
__NOTOC__
__NOTOC__
This event is fired when a player or ped has entered a vehicle.
This event is fired when a player has entered a vehicle.


==Parameters==
==Parameters==
Line 11: Line 11:


==Source==
==Source==
The [[event system#Event source|source]] of this event is the [[player]] or [[ped]] that entered the vehicle.
The [[event system#Event source|source]] of this event is the [[player]] that entered the vehicle.


==Example==
==Example==
Line 23: Line 23:


==See Also==
==See Also==
'''<big>Related</big>'''
'''<big>Related</big>'''
</br>
</br>
[[onClientVehicleStartEnter]]
[[onClientVehicleStartEnter]]
</br>
</br>
[[onClientVehicleStartExit]]
[[onClientVehicleExit]]


===Client player events===
===Client player events===

Latest revision as of 18:31, 29 November 2020

This event is fired when a player has entered a vehicle.

Parameters

vehicle theVehicle, int seat
  • theVehicle: the vehicle that the player entered
  • seat: the seat that the player now is on. Driver's seat = 0, higher numbers are passenger seats.

Source

The source of this event is the player that entered the vehicle.

Example

This example will tell you the name of the vehicle you enter.

function checkVehicles(theVehicle)
	outputChatBox("You entered a "..getVehicleName(theVehicle).."!")
end
addEventHandler("onClientPlayerVehicleEnter", localPlayer, checkVehicles)

See Also

Related
onClientVehicleStartEnter
onClientVehicleExit

Client player events


Client event functions