SetCameraDrunkLevel: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0161|1.6.0|21795|This function sets the camera drunk level (as seen on the ''Are you going to San Fierro?'' singleplayer mission). This function was renamed from setCameraShakeLevel.}} Drunk effect is a wavy motion of the camera depicting the player being drunk. This function used to be called setCameraShakeLevel which has since been deprecated. ==Syntax== <syntaxhighlight lang="lua"> bool setCameraDrunkLevel...") |
No edit summary |
||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
{{Important Note|This function usually presents bugs when trying to return the state to 0 (normal).}} | |||
{{New feature/item|3.0161|1.6.0|21795|This function sets the camera drunk level (as seen on the ''Are you going to San Fierro?'' singleplayer mission). This function was renamed from [[setCameraShakeLevel]].}} | {{New feature/item|3.0161|1.6.0|21795|This function sets the camera drunk level (as seen on the ''Are you going to San Fierro?'' singleplayer mission). This function was renamed from [[setCameraShakeLevel]].}} | ||
Revision as of 19:15, 21 July 2023
Important Note: This function usually presents bugs when trying to return the state to 0 (normal). |
Drunk effect is a wavy motion of the camera depicting the player being drunk. This function used to be called setCameraShakeLevel which has since been deprecated.
Syntax
bool setCameraDrunkLevel ( int shakeLevel )
Required arguments
- drunkLevel: an integer between 0 and 255, which represents the camera drunk intensity level.
Returns
Returns true if the camera drunk level was changed, false if the required argument is incorrect or missing.
Example
This example adds a /camdrunk command which allows any player to manually change its camera drunk level.
addCommandHandler( "camdrunk", function( _, level ) local level = math.floor( level ) if level and level >= 0 and level <= 255 then setCameraDrunkLevel( level ) outputChatBox( "Camera drunk level updated to " .. level .. "." ) else outputChatBox( "Camera drunk level must be between 0 and 255." ) end end )
See also
- getCamera
- getCameraClip
- getCameraFieldOfView
- getCameraGoggleEffect
- getCameraViewMode
- setCameraClip
- setCameraFieldOfView
- setCameraGoggleEffect
- setCameraViewMode
- Shared
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget