SetPlayerCanBeKnockedOffBike: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 16: | Line 16: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function changeCanBeKnockedOff ( command ) | function changeCanBeKnockedOff ( command ) | ||
-- The player should enter /knock | -- 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 | end | ||
addCommandHandler ( "knock", changeCanBeKnockedOff ) | addCommandHandler ( "knock", changeCanBeKnockedOff ) |
Revision as of 18:17, 30 March 2008
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 sets the canBeKnockedOff status true or false.
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