OnPlayerVehicleExit: Difference between revisions
Jump to navigation
Jump to search
Capsinurass (talk | contribs) |
Capsinurass (talk | contribs) |
||
Line 23: | Line 23: | ||
end | end | ||
end | end | ||
addEventHandler ( " | addEventHandler ( "onPlayerVehicleEnter", getRootElement(), addHelmetOnEnter ) | ||
function removeHelmetOnExit ( vehicle, seat, jacked ) | function removeHelmetOnExit ( vehicle, seat, jacked ) |
Revision as of 05:18, 2 March 2008
This event is triggered when a player leaves a vehicle, for whatever reason.
Parameters
vehicle theVehicle, int seat, player jacker
- theVehicle: A vehicle element representing the vehicle in which the player exited from
- seat: An integer representing the seat in which the player was before exiting
- jacker: A player element representing the player who jacked the driver
Source
The source of this event is the player that entered the vehicle.
Example
This example adds a 'moto' helmet to a player when he gets on a nrg bike, and removes it when he gets off.
function addHelmetOnEnter ( vehicle, seat, jacked ) if ( getVehicleID ( vehicle ) == 522 ) then -- if its a nrg addPlayerClothes ( source, "moto", "moto", 16 ) -- add the helmet end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), addHelmetOnEnter ) function removeHelmetOnExit ( vehicle, seat, jacked ) if ( getVehicleID ( vehicle ) == 522 ) then -- if its a nrg removePlayerClothes ( source, 16 ) -- remove the helmet end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), removeHelmetOnExit )
See Also
Player events
- onPlayerACInfo
- onPlayerBan
- onPlayerChangeNick
- onPlayerChat
- onPlayerClick
- onPlayerCommand
- onPlayerConnect
- onPlayerContact
- onPlayerDamage
- onPlayerJoin
- onPlayerLogin
- onPlayerLogout
- onPlayerMarkerHit
- onPlayerMarkerLeave
- onPlayerModInfo
- onPlayerMute
- onPlayerNetworkStatus
- onPlayerPickupHit
- onPlayerPickupLeave
- onPlayerPickupUse
- onPlayerPrivateMessage
- onPlayerQuit
- onPlayerScreenShot
- onPlayerSpawn
- onPlayerStealthKill
- onPlayerTarget
- onPlayerUnmute
- onPlayerVehicleEnter
- onPlayerVehicleExit
- onPlayerVoiceStart
- onPlayerVoiceStop
- onPlayerWasted
- onPlayerWeaponFire
- onPlayerWeaponSwitch
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled