HU/setCameraShakeLevel

From Multi Theft Auto: Wiki
Revision as of 15:30, 26 August 2018 by Surge (talk | contribs) (Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0150|1.5|7343| This function sets the camera shake level (as seen on the ''Are you going to San Fierro?'' singleplayer missi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function sets the camera shake level (as seen on the Are you going to San Fierro? singleplayer mission).

Syntax

bool setCameraShakeLevel ( int shakeLevel )

Required arguments

  • shakeLevel: an integer between 0 and 255, which represents the camera shake intensity level.

Returns

Returns true if the camera shake level was changed, false if the required argument is incorrect or missing.

Example

This example adds a /camshake command which allows any player to manually change its camera shake level.

addCommandHandler( "camshake",
    function( _, level )
        local level = math.floor( level )
        if level and level >=0 and level <= 255 then
            setCameraShakeLevel( level )
            outputChatBox( "Camera shake level updated to " .. level .. "." )
        else
            outputChatBox( "Camera shake level must be between 0 and 255." )
        end
    end
)

See also