OnClientPlayerVehicleExit: Difference between revisions
Jump to navigation
Jump to search
m (Needs Example) |
m (This event is only for players) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Client event}} | {{Client event}} | ||
__NOTOC__ | __NOTOC__ | ||
This event is triggered when a player | This event is triggered when a player has exited a vehicle. | ||
==Parameters== | ==Parameters== | ||
Line 16: | Line 14: | ||
==Example== | ==Example== | ||
This example outputs a chat box message with player's name and vehicle name when someone leave vehicle. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler("onClientPlayerVehicleExit", getRootElement(), | |||
function (vehicle, seat) | |||
local vehicleName = getVehicleName(vehicle) | |||
outputChatBox("Player " .. getPlayerName(source) .. " has left the " .. vehicleName) | |||
end) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
'''<big>Related</big>''' | |||
</br> | |||
[[onClientVehicleStartExit]] | |||
</br> | |||
[[onClientVehicleEnter]] | |||
===Client player events=== | ===Client player events=== | ||
{{Client_player_events}} | {{Client_player_events}} | ||
===Client event functions=== | ===Client event functions=== | ||
{{Client_event_functions}} | {{Client_event_functions}} |
Latest revision as of 11:45, 13 August 2024
This event is triggered when a player has exited a vehicle.
Parameters
vehicle theVehicle, int seat
- theVehicle: the vehicle that the player exited.
- seat: the number of the seat that the player was sitting on.
Source
The source of this event is the player that exited the vehicle.
Example
This example outputs a chat box message with player's name and vehicle name when someone leave vehicle.
addEventHandler("onClientPlayerVehicleExit", getRootElement(), function (vehicle, seat) local vehicleName = getVehicleName(vehicle) outputChatBox("Player " .. getPlayerName(source) .. " has left the " .. vehicleName) end)
See Also
Related
onClientVehicleStartExit
onClientVehicleEnter
Client player events
- onClientPlayerChangeNick
- onClientPlayerChoke
- onClientPlayerDamage
- onClientPlayerHeliKilled
- onClientPlayerHitByWaterCannon
- onClientPlayerJoin
- onClientPlayerPickupHit
- onClientPlayerPickupLeave
- onClientPlayerQuit
- onClientPlayerRadioSwitch
- onClientPlayerSpawn
- onClientPlayerStealthKill
- onClientPlayerStuntFinish
- onClientPlayerStuntStart
- onClientPlayerTarget
- onClientPlayerVehicleEnter
- onClientPlayerVehicleExit
- onClientPlayerVoicePause
- onClientPlayerVoiceResumed
- onClientPlayerVoiceStart
- onClientPlayerVoiceStop
- onClientPlayerWasted
- onClientPlayerWeaponFire
- onClientPlayerWeaponSwitch
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled