SetCameraShakeLevel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Updated and improved the page)
Line 19: Line 19:
addCommandHandler( "camshake",
addCommandHandler( "camshake",
     function( _, level )
     function( _, level )
         local level = math.floor( tonumber( level ) )
         local level = math.floor( level )
         if level then
         if level then
             setCameraShakeLevel( level )
             setCameraShakeLevel( level )

Revision as of 13:21, 11 July 2015

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

addCommandHandler( "camshake",
    function( _, level )
        local level = math.floor( level )
        if level 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