HU/getCameraShakeLevel: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0150|1.5|7344| This function gets the camera shake level set by setCameraShakeLevel.}} ==Syntax== <syntaxhighlight lan...") |
|||
Line 29: | Line 29: | ||
{{Client camera functions hu}} | {{Client camera functions hu}} | ||
[[ | [[en:getCameraShakLevel]] |
Revision as of 15:24, 26 August 2018
This function gets the camera shake level set by setCameraShakeLevel.
Syntax
int getCameraShakeLevel ( )
Returns
Returns an integer representing the camera shake level, from 0 (no shaking effect) to 255 (maximum shaking effect). By default, the camera has no shaking effect.
Example
This example checks for changes in the camera shake level of any player every frame and outputs different messages according to it.
local lastDrunkLevel = getCameraShakeLevel() local function warnPlayerAboutDrunkenness() local currentDrunkLevel = getCameraShakeLevel() if currentDrunkLevel ~= lastDrunkLevel and (currentDrunkLevel == 0 or currentDrunkLevel == 255) then outputChatBox(currentDrunkLevel == 255 and "You're completly drunk! You should stop drinking!" or "Now you are completely sober! You sohuld keep it like that.", currentDrunkLevel == 255 and 255 or 0, currentDrunkLevel == 0 and 255 or 0, 0) end lastDrunkLevel = currentDrunkLevel end addEventHandler("onClientRender", root, warnPlayerAboutDrunkenness)
See also
- HU/fadeCamera
- HU/getCamera
- HU/getCameraClip
- HU/getCameraFieldOfView
- HU/getCameraGoggleEffect
- HU/getCameraInterior
- HU/getCameraMatrix
- HU/getCameraShakeLevel
- HU/getCameraTarget
- HU/getCameraViewMode
- HU/setCameraClip
- HU/setCameraFieldOfView
- HU/setCameraGoggleEffect
- HU/setCameraInterior
- HU/setCameraMatrix
- HU/setCameraShakeLevel
- HU/setCameraTarget
- HU/setCameraViewMode