canPedBeKnockedOffBike | Multi Theft Auto: Wiki Skip to content

canPedBeKnockedOffBike

Client-side
Server-side
Shared

Pair: setPedCanBeKnockedOffBike

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function checks if the given ped can fall off bikes.

Syntax

canPedBeKnockedOffBike ( )

Code Examples

client

This example adds a console command with which the local player can toggle whether he can fall off bikes.

function changeCanBeKnockedOff ( command )
-- lets players be knocked off bikes if it was set to false, true otherwise
local bCanBeKnockedOff = canPedBeKnockedOffBike(localPlayer)
setPedCanBeKnockedOffBike(localPlayer, not bCanBeKnockedOff)
-- outputs the respective message
outputChatBox( ('Now you %s be knocked off your bike.'):format(bCanBeKnockedOff and 'can\'t' or 'can') )
end
addCommandHandler('knock', changeCanBeKnockedOff)

See Also