OnClientPlayerVehicleExit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Needs Example)
m (Added example)
Line 1: Line 1:
[[Category:Incomplete Event]]
[[Category:Incomplete Event]]
{{Client event}}
{{Client event}}
{{Needs Example}}
__NOTOC__  
__NOTOC__  
This event is triggered when a player exits a vehicle.
This event is triggered when a player exits a vehicle.
Line 16: Line 15:


==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">
--TODO
addEventHandler("onClientPlayerVehicleExit", getRootElement(),
 
function (vehicle, seat)
 
local vehicleName = getVehicleName(vehicle)
outputChatBox("Player " .. getPlayerName(source) .. " has left the " .. vehicleName)
 
end)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 18:47, 28 February 2012

This event is triggered when a player exits 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

Client player events


Client event functions