Cam::createCinematicShot: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{ClientsideJsFunction}}
{{JSContainer|


==Syntax==
The `createCinematicShot` function in RageMP initiates a cinematic camera shot that can be focused on a specific entity. This function allows you to create a dramatic view, useful for cutscenes or special sequences where a more controlled camera angle is needed.
<syntaxhighlight lang="javascript">cam.createCinematicShot(p0, p1, p2, entity);</syntaxhighlight>
 
=== Required Arguments ===
The parameters `p0`, `p1`, and `p2` are not fully documented, but `entity` specifies the object or player to focus the cinematic shot on.
*'''p0:''' unknown (to be checked)
 
*'''p1:''' int
=== Required Params ===
*'''p2:''' unknown (to be checked)
* '''p0:''' {{RageType|unknown}} – Purpose unknown (requires testing).
*'''entity:''' Entity handle or object
* '''p1:''' {{RageType|int}} – Possibly shot mode/type.
===Return value===
* '''p2:''' {{RageType|unknown}} – Purpose unknown (requires testing).
*'''Undefined'''
* '''entity:''' {{RageType|Entity}} – The entity handle or object to target for the cinematic shot.
==Example==
 
=== Return Value ===
* '''Undefined''' – This function does not return a value.
 
== Syntax ==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
mp.game.cam.createCinematicShot(p0, p1, p2, entity);
</syntaxhighlight>
 
== Example ==
<syntaxhighlight lang="javascript">
// Example usage of createCinematicShot
const player = mp.players.local;
const cam = mp.cameras.new("default", new mp.Vector3(0, 0, 10), new mp.Vector3(0, 0, 0), 60);
cam.setActive(true);
mp.game.cam.renderScriptCams(true, false, 0, true, false);
 
const targetEntity = player.handle; // Replace with any valid entity handle
 
// Initiate a cinematic shot focused on the player entity
mp.game.cam.createCinematicShot(cam.handle, 1, 0, targetEntity);
mp.gui.chat.push("Cinematic shot created for player.");
</syntaxhighlight>
</syntaxhighlight>
==See also==
}}
== See Also ==
{{Cam_s_function_c}}
{{Cam_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 09:36, 2 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


The `createCinematicShot` function in RageMP initiates a cinematic camera shot that can be focused on a specific entity. This function allows you to create a dramatic view, useful for cutscenes or special sequences where a more controlled camera angle is needed.

The parameters `p0`, `p1`, and `p2` are not fully documented, but `entity` specifies the object or player to focus the cinematic shot on.

Required Params

  • p0: unknown – Purpose unknown (requires testing).
  • p1: int – Possibly shot mode/type.
  • p2: unknown – Purpose unknown (requires testing).
  • entity: Entity – The entity handle or object to target for the cinematic shot.

Return Value

  • Undefined – This function does not return a value.

Syntax

mp.game.cam.createCinematicShot(p0, p1, p2, entity);

Example

// Example usage of createCinematicShot
const player = mp.players.local;
const cam = mp.cameras.new("default", new mp.Vector3(0, 0, 10), new mp.Vector3(0, 0, 0), 60);
cam.setActive(true);
mp.game.cam.renderScriptCams(true, false, 0, true, false);

const targetEntity = player.handle; // Replace with any valid entity handle

// Initiate a cinematic shot focused on the player entity
mp.game.cam.createCinematicShot(cam.handle, 1, 0, targetEntity);
mp.gui.chat.push("Cinematic shot created for player.");


See Also

Template:Cam s function c