OnClientPlayerStuntFinish

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This event is triggered whenever the local player finishes a vehicle stunt.

Parameters

string stuntType, int stuntTime, float stuntDistance
  • stuntType: the type of stunt the player just performed. Valid types are:
    • 2wheeler
    • wheelie
    • stoppie
  • stuntTime: the number of miliseconds the stunt lasted.
  • stuntDistance: the distance traveled while doing the stunt.

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


Client event functions