SetPlayerCanBeKnockedOffBike: Difference between revisions
Jump to navigation
Jump to search
(New page: ==Syntax== <syntaxhighlight lang="lua"> bool setPlayerCanBeKnockedOffBike ( player thePlayer, int canBeKnockedOffBike ) </syntaxhighlight> 0: BIKE_KNOCK_OFF_DEFAULT 1: BIKE_KNOCK_OFF_NEVER 2: BIKE_KNOCK_...) |
(Deprecated function) |
||
(10 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | |||
{{Client function}} | |||
{{Deprecated|setPedCanBeKnockedOffBike}} | |||
This function controls if you can fall of your bike by accident - namely by banging into a wall. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setPlayerCanBeKnockedOffBike ( player thePlayer, | bool setPlayerCanBeKnockedOffBike ( player thePlayer, bool canBeKnockedOffBike ) | ||
</syntaxhighlight> | |||
===Required Arguments=== | |||
*'''thePlayer:''' the player whose knockoffstatus being changed | |||
*'''state:''' the true or false state | |||
==Example== | |||
This example allows the local player to toggle whether or not he can fall of bikes. | |||
<syntaxhighlight lang="lua"> | |||
function changeCanBeKnockedOff ( command ) | |||
-- The player should enter /knock | |||
if canPedBeKnockedOffBike ( getLocalPlayer() ) then | |||
setPlayerCanBeKnockedOffBike ( getLocalPlayer(), false ) | |||
outputChatBox ( "Now you can't be knocked off your bike." ) | |||
else | |||
setPlayerCanBeKnockedOffBike ( getLocalPlayer(), true ) | |||
outputChatBox ( "Now you can be knocked off your bike." ) | |||
end | |||
end | |||
addCommandHandler ( "knock", changeCanBeKnockedOff ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | |||
{{Player functions}} | |||
Latest revision as of 01:07, 11 September 2016
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use setPedCanBeKnockedOffBike instead. |
This function controls if you can fall of your bike by accident - namely by banging into a wall.
Syntax
bool setPlayerCanBeKnockedOffBike ( player thePlayer, bool canBeKnockedOffBike )
Required Arguments
- thePlayer: the player whose knockoffstatus being changed
- state: the true or false state
Example
This example allows the local player to toggle whether or not he can fall of bikes.
function changeCanBeKnockedOff ( command ) -- The player should enter /knock if canPedBeKnockedOffBike ( getLocalPlayer() ) then setPlayerCanBeKnockedOffBike ( getLocalPlayer(), false ) outputChatBox ( "Now you can't be knocked off your bike." ) else setPlayerCanBeKnockedOffBike ( getLocalPlayer(), true ) outputChatBox ( "Now you can be knocked off your bike." ) end end addCommandHandler ( "knock", changeCanBeKnockedOff )
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState