Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[HELP] Custom Cameras using RagePluginHook API

Featured Replies

Hello everybody! I have a problem making a plugin. Well,

I need a camera which position is, lets say, Vector3.Zero;

So,

Rage.Camera MyCam = new Camera("DEFAULT_SCRIPTED_CAMERA", false); //Strig is CAMERA TYPE and Bool is ACTIVATED

Then I modify Position, Rotation and FOV:

MyCam.Position = Vector3.Zero;
MyCam.Rotation = new Rotator(180.0f, -90.0f, 0.0f);
MyCam.FOV = 75.0f;

But when I need to activate It, I don't know how to do it.

I tried

MyCam.Active = true;

After this, ingame camera is not active, I can not move it, but it's the same as it was before.

I think, I need to deactivate the previous camera to activate the new one. How to do it?

And, can you please, give an example of switching camera to a new one and back to the default.

Thank you.

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

I would recommend changing your camera to this:

Camera myCam = new Camera(false);

I've gotten all my cameras to work using that.

As for switching cameras, you can get the gamecamera using the gameplay_cam natives and set that camera active when you want it active.

 

 

  • Author
5 minutes ago, Fiskey111 said:

I would recommend changing your camera to this:


Camera myCam = new Camera(false);

I've gotten all my cameras to work using that.

As for switching cameras, you can get the gamecamera using the gameplay_cam natives and set that camera active when you want it active.

And how do I deactivate a camera?

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

  • Author
13 minutes ago, Fiskey111 said:

Simply set the camera.active to false.

Okay, one more thing.

I need to display a help with custom Keybinding, for example, E.

Like this

Spoiler

V5rNUnp.png

As for now I do

Game.DisplayHelp("Press ~INPUT_CONTEXT~ to start duty");

But If I do not have E binded to Context in setting, another key will show up. How can I place custom Keys in there?

@Fiskey111 , should I use

Cam GET_RENDERING_CAM() // 0x5234F9F10919EABA 0x0FCF4DF1

?

Because I do not find GET_GAMEPLAY_CAM. There are only GET_GAMEPLAY_CAM_POSITION, ROTATION, FOV etc.

Edited by Fenix2525WOT

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

  • Author
47 minutes ago, Fiskey111 said:

Simply set the camera.active to false.

When I set camera.Active to true or false I get Null Reference exeption. What's wrong?

Camera CharacterDesignerCam = new Camera(false);
CharacterDesignerCam.Position = Game.LocalPlayer.Character.GetOffsetPositionFront(3.0f) + new Vector3(0.0f, 0.0f, 0.5f);
CharacterDesignerCam.Rotation = Game.LocalPlayer.Character.Rotation + new Rotator(0.0f, 0.0f, 180.0f);
CharacterDesignerCam.FOV = 60.0f;
CharacterDesignerCam.Active = true;

 

header.png.584c28e8d611130062860b2efc498fc2.png

Los Santos Rescue Division Developer

CLICK HERE TO LEARN MORE

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.