Cam::getFollowPedViewMode: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
{{ClientsideJsFunction}} | {{ClientsideJsFunction}} | ||
{{JSContainer| | {{JSContainer| | ||
===Explanation=== | |||
The `getFollowPedViewMode` function retrieves the current camera view mode used to follow the player’s character (ped). It returns an integer representing the view mode, which you can use to determine the player's current perspective. | |||
===View Mode Values=== | |||
* 0 - Third Person Close | |||
* 1 - Third Person Mid | |||
* 2 - Third Person Far | |||
* 4 - First Person | |||
===Return value=== | ===Return value=== | ||
*''' {{RageType|number}} ''' | *'''{{RageType|number}}''' — The view mode ID as an integer. | ||
==Syntax== | ==Syntax== | ||
| Line 16: | Line 20: | ||
==Example== | ==Example== | ||
This example checks the current view mode and displays a message based on the player’s perspective. | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
// | // Get the current follow ped view mode | ||
const viewMode = mp.game.cam.getFollowPedViewMode(); | |||
switch(viewMode) { | |||
case 0: | |||
mp.gui.chat.push("View Mode: Third Person Close"); | |||
break; | |||
case 1: | |||
mp.gui.chat.push("View Mode: Third Person Mid"); | |||
break; | |||
case 2: | |||
mp.gui.chat.push("View Mode: Third Person Far"); | |||
break; | |||
case 4: | |||
mp.gui.chat.push("View Mode: First Person"); | |||
break; | |||
default: | |||
mp.gui.chat.push("Unknown View Mode"); | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
Latest revision as of 15:53, 9 November 2024
Client-Side Function
JavaScript Syntax
Explanation
The `getFollowPedViewMode` function retrieves the current camera view mode used to follow the player’s character (ped). It returns an integer representing the view mode, which you can use to determine the player's current perspective.
View Mode Values
- 0 - Third Person Close
- 1 - Third Person Mid
- 2 - Third Person Far
- 4 - First Person
Return value
- 'number' — The view mode ID as an integer.
Syntax
mp.game.cam.getFollowPedViewMode()
Example
This example checks the current view mode and displays a message based on the player’s perspective.
// Get the current follow ped view mode
const viewMode = mp.game.cam.getFollowPedViewMode();
switch(viewMode) {
case 0:
mp.gui.chat.push("View Mode: Third Person Close");
break;
case 1:
mp.gui.chat.push("View Mode: Third Person Mid");
break;
case 2:
mp.gui.chat.push("View Mode: Third Person Far");
break;
case 4:
mp.gui.chat.push("View Mode: First Person");
break;
default:
mp.gui.chat.push("Unknown View Mode");
}
See also
- mp.game.cam.renderScriptS
- mp.game.cam.renderScriptCams
- mp.game.cam.stopRenderingScriptCamsUsingCatchUp
- mp.game.cam.create
- mp.game.cam.createCam
- mp.game.cam.createWithParams
- mp.game.cam.createCamWithParams
- mp.game.cam.createEra
- mp.game.cam.createCamera
- mp.game.cam.createEraWithParams
- mp.game.cam.createCameraWithParams
- mp.game.cam.destroy
- mp.game.cam.destroyAllS
- mp.game.cam.destroyAllCams
- mp.game.cam.doesExist
- mp.game.cam.setActive
- mp.game.cam.isActive
- mp.game.cam.isRendering
- mp.game.cam.getRendering
- mp.game.cam.getCoord
- mp.game.cam.getRot
- mp.game.cam.getFov
- mp.game.cam.getNearClip
- mp.game.cam.getFarClip
- mp.game.cam.getFarDof
- mp.game.cam.setParams
- mp.game.cam.setCoord
- mp.game.cam.setRot
- mp.game.cam.setFov
- mp.game.cam.setNearClip
- mp.game.cam.setFarClip
- mp.game.cam.setMotionBlurStrength
- mp.game.cam.setNearDof
- mp.game.cam.setFarDof
- mp.game.cam.setDofStrength
- mp.game.cam.setDofPlanes
- mp.game.cam.setUseShallowDofMode
- mp.game.cam.setUseHiDof
- mp.game.cam.setDofFnumberOfLens
- mp.game.cam.setDofFocalLengthMultiplier
- mp.game.cam.setDofFocusDistanceBias
- mp.game.cam.setDofMaxNearInFocusDistance
- mp.game.cam.setDofMaxNearInFocusDistanceBlendLevel
- mp.game.cam.attachToEntity
- mp.game.cam.attachToPedBone
- mp.game.cam.attachToPedBone2
- mp.game.cam.attachToVehicleBone
- mp.game.cam.detach
- mp.game.cam.setInheritRollVehicle
- mp.game.cam.pointAtCoord
- mp.game.cam.pointAtEntity
- mp.game.cam.pointAtPedBone
- mp.game.cam.stopPointing
- mp.game.cam.setAffectsAiming
- mp.game.cam.setDebugName
- mp.game.cam.addSplineNode
- mp.game.cam.addCamSplineNode
- mp.game.cam.addSplineNodeUsingCameraFrame
- mp.game.cam.addSplineNodeUsingCamera
- mp.game.cam.addSplineNodeUsingGameplayFrame
- mp.game.cam.setSplinePhase
- mp.game.cam.setCamSplinePhase
- mp.game.cam.getSplinePhase
- mp.game.cam.getSplineNodePhase
- mp.game.cam.getCamSplineNodePhase
- mp.game.cam.setSplineDuration
- mp.game.cam.setCamSplineDuration
- mp.game.cam.setSplineSmoothingStyle
- mp.game.cam.getSplineNodeIndex
- mp.game.cam.getCamSplineNodeIndex
- mp.game.cam.setSplineNodeEase
- mp.game.cam.setSplineNodeVelocityScale
- mp.game.cam.overrideSplineVelocity
- mp.game.cam.overrideCamSplineVelocity
- mp.game.cam.overrideSplineMotionBlur
- mp.game.cam.overrideCamSplineMotionBlur
- mp.game.cam.setSplineNodeExtraFlags
- mp.game.cam.isSplinePaused
- mp.game.cam.isCamSplinePaused
- mp.game.cam.setActiveWithInterp
- mp.game.cam.isInterpolating
- mp.game.cam.shake
- mp.game.cam.animatedShake
- mp.game.cam.isShaking
- mp.game.cam.setShakeAmplitude
- mp.game.cam.stopShaking
- mp.game.cam.shakeScriptGlobal
- mp.game.cam.animatedShakeScriptGlobal
- mp.game.cam.isScriptGlobalShaking
- mp.game.cam.stopScriptGlobalShaking
- mp.game.cam.playAnim
- mp.game.cam.isPlayingAnim
- mp.game.cam.setAnimCurrentPhase
- mp.game.cam.getAnimCurrentPhase
- mp.game.cam.playSynchronizedAnim
- mp.game.cam.playSynchronizedCamAnim
- mp.game.cam.setFlyHorizontalResponse
- mp.game.cam.setFlyVerticalSpeedMultiplier
- mp.game.cam.setFlyMaxHeight
- mp.game.cam.setFlyCoordAndConstrain
- mp.game.cam.isScreenFadedOut
- mp.game.cam.isScreenFadedIn
- mp.game.cam.isScreenFadingOut
- mp.game.cam.isScreenFadingIn
- mp.game.cam.doScreenFadeIn
- mp.game.cam.doScreenFadeOut
- mp.game.cam.setWidescreenBorders
- mp.game.cam.getGameplayCoord
- mp.game.cam.getGameplayRot
- mp.game.cam.getGameplayCamRot
- mp.game.cam.getGameplayFov
- mp.game.cam.getGameplayRelativeHeading
- mp.game.cam.getGameplayCamRelativeHeading
- mp.game.cam.setGameplayRelativeHeading
- mp.game.cam.setGameplayCamRelativeHeading
- mp.game.cam.getGameplayRelativePitch
- mp.game.cam.setGameplayRelativePitch
- mp.game.cam.setGameplayCamRelativePitch
- mp.game.cam.setGameplayRelativeRotation
- mp.game.cam.setGameplayRawYaw
- mp.game.cam.setGameplayCamRawYaw
- mp.game.cam.setGameplayRawPitch
- mp.game.cam.setGameplayCamRawPitch
- mp.game.cam.shakeGameplay
- mp.game.cam.shakeGameplayCam
- mp.game.cam.isGameplayShaking
- mp.game.cam.setGameplayShakeAmplitude
- mp.game.cam.setGameplayCamShakeAmplitude
- mp.game.cam.stopGameplayShaking
- mp.game.cam.stopGameplayCamShaking
- mp.game.cam.setGameplayFollowPedThisUpdate
- mp.game.cam.isGameplayRendering
- mp.game.cam.enableCrosshairThisFrame
- mp.game.cam.isGameplayLookingBehind
- mp.game.cam.disableCollisionForEntity
- mp.game.cam.disableCollisionForObject
- mp.game.cam.isSphereVisible
- mp.game.cam.isFollowPedActive
- mp.game.cam.setFollowPedThisUpdate
- mp.game.cam.setFollowPedCamCutsceneChat
- mp.game.cam.clampGameplayYaw
- mp.game.cam.clampGameplayCamYaw
- mp.game.cam.clampGameplayPitch
- mp.game.cam.clampGameplayCamPitch
- mp.game.cam.animateGameplayZoom
- mp.game.cam.animateGameplayCamZoom
- mp.game.cam.setInVehicleStateThisUpdate
- mp.game.cam.disableFirstPersonThisFrame
- mp.game.cam.getFollowPedZoomLevel
- mp.game.cam.getFollowPedViewMode
- mp.game.cam.setFollowPedViewMode
- mp.game.cam.setFollowPedCamViewMode
- mp.game.cam.isFollowVehicleActive
- mp.game.cam.getFollowVehicleZoomLevel
- mp.game.cam.setFollowVehicleZoomLevel
- mp.game.cam.setFollowVehicleCamZoomLevel
- mp.game.cam.getFollowVehicleViewMode
- mp.game.cam.setFollowVehicleViewMode
- mp.game.cam.setFollowVehicleCamViewMode
- mp.game.cam.useStuntEraThisFrame
- mp.game.cam.setGameplayHash
- mp.game.cam.setFollowTurretSeat
- mp.game.cam.isAimActive
- mp.game.cam.isAimThirdPersonActive
- mp.game.cam.isFirstPersonAimActive
- mp.game.cam.disableAimThisUpdate
- mp.game.cam.getFirstPersonAimZoomFactor
- mp.game.cam.setFirstPersonAimZoomFactor
- mp.game.cam.setFirstPersonPitchRange
- mp.game.cam.setFirstPersonAimNearClipThisUpdate
- mp.game.cam.setThirdPersonAimNearClipThisUpdate
- mp.game.cam.getFinalRenderedCoord
- mp.game.cam.getFinalRenderedRot
- mp.game.cam.getFinalRenderedInWhenFriendlyRot
- mp.game.cam.getFinalRenderedFov
- mp.game.cam.getFinalRenderedInWhenFriendlyFov
- mp.game.cam.getFinalRenderedNearClip
- mp.game.cam.getFinalRenderedFarClip
- mp.game.cam.getFinalRenderedNearDof
- mp.game.cam.getFinalRenderedFarDof
- mp.game.cam.getFinalRenderedMotionBlurStrength
- mp.game.cam.setGameplayCoordHint
- mp.game.cam.setGameplayPedHint
- mp.game.cam.setGameplayVehicleHint
- mp.game.cam.setGameplayObjectHint
- mp.game.cam.setGameplayEntityHint
- mp.game.cam.isGameplayHintActive
- mp.game.cam.stopGameplayHint
- mp.game.cam.setGameplayHintFov
- mp.game.cam.setGameplayHintFollowDistanceScalar
- mp.game.cam.setGameplayHintBaseOrbitPitchOffset
- mp.game.cam.setGameplayHintAnimOffsetx
- mp.game.cam.setGameplayHintAnimOffsety
- mp.game.cam.setGameplayHintAnimCloseup
- mp.game.cam.getIsMultiplayerBrief
- mp.game.cam.setCinematicButtonActive
- mp.game.cam.isCinematicRendering
- mp.game.cam.shakeCinematic
- mp.game.cam.shakeCinematicCam
- mp.game.cam.isCinematicShaking
- mp.game.cam.setCinematicShakeAmplitude
- mp.game.cam.setCinematicCamShakeAmplitude
- mp.game.cam.stopCinematicShaking
- mp.game.cam.stopCinematicCamShaking
- mp.game.cam.disableVehicleFirstPersonThisFrame
- mp.game.cam.invalidateVehicleIdle
- mp.game.cam.invalidateIdle
- mp.game.cam.isCinematicIdleRendering
- mp.game.cam.isInVehicleDisabled
- mp.game.cam.createCinematicShot
- mp.game.cam.isCinematicShotActive
- mp.game.cam.stopCinematicShot
- mp.game.cam.forceCinematicRenderingThisUpdate
- mp.game.cam.setCinematicModeActive
- mp.game.cam.isCinematicActive
- mp.game.cam.stopCutsceneShaking
- mp.game.cam.getFocusPedOnScreen
- mp.game.cam.setEffect
- mp.game.cam.setCamEffect
- mp.game.cam.setGameplayVehicleCamera
- mp.game.cam.setGameplayVehicleCameraName
- mp.game.cam.replayFreeGetMaxRange
- mp.game.cam.setDofParam
- mp.game.cam.getDofParam