OnClientPlayerStuntStart: Difference between revisions
Jump to navigation
Jump to search
(Dox'd) |
(Improve example.) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
This is a simple stunt script which tells player what stunt he/she started and finished, time the stunt taken to perform and distance travelled while stunting. | |||
<syntaxhighlight lang="lua"> | |||
function onClientPlayerStuntStart(stuntType) | |||
outputChatBox("You started stunt: "..stuntType) | |||
end | |||
addEventHandler("onClientPlayerStuntStart", localPlayer, onClientPlayerStuntStart) | |||
function onClientPlayerStuntFinish(stuntType, stuntTime, stuntDistance) | |||
outputChatBox("You finished stunt: "..stuntType..", time: "..stuntTime..", distance: "..stuntDistance) | |||
end | |||
addEventHandler("onClientPlayerStuntFinish", localPlayer, onClientPlayerStuntFinish) | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{ | ===Client player events=== | ||
{{Client_player_events}} | |||
===Client event functions=== | |||
{{Client_event_functions}} |
Latest revision as of 07:58, 16 September 2021
This event is triggered whenever the local player starts doing a vehicle stunt.
Parameters
string stuntType
- stuntType: the type of stunt the player is starting to perform. Valid types are:
- 2wheeler
- wheelie
- stoppie
Source
The source of this event is the local player.
Example
This is a simple stunt script which tells player what stunt he/she started and finished, time the stunt taken to perform and distance travelled while stunting.
function onClientPlayerStuntStart(stuntType) outputChatBox("You started stunt: "..stuntType) end addEventHandler("onClientPlayerStuntStart", localPlayer, onClientPlayerStuntStart) function onClientPlayerStuntFinish(stuntType, stuntTime, stuntDistance) outputChatBox("You finished stunt: "..stuntType..", time: "..stuntTime..", distance: "..stuntDistance) end addEventHandler("onClientPlayerStuntFinish", localPlayer, onClientPlayerStuntFinish)
See Also
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