Jump to content

SA - Cam Pos / LD


Gorkem95

Recommended Posts

Hello, Im trying to change camera pos/looking vectors but its not working well after attached to an entity

 

Before camera attached an ped or entity(when fixed mode)

 

CamSAInterface 

+0x160 - Fixed Pos

+0x16C - Fixed Look Pos

 

If i change these adresses in fixed mod its works but after camera mode change(attached) not working, im try to 

 

+0xC - Mode

+0x19C - Pos

+0x1B4 - Look Pos

change camera mode to fixed again and update cam pos every frame but its only works once I tried to call CamSA-RestoreWithJumpCut to update camera pos but its not looks good(cam jumps behind of last attached ped for sec)

 

How can i fix this or in scm these opcodes are works well 015F 0160 how can i call scm in c++?
 

 

Link to comment
https://gtaforums.com/topic/975916-sa-cam-pos-ld/
Share on other sites

15 hours ago, Gorkem95 said:

How can i fix this or in scm these opcodes are works well 015F 0160 how can i call scm in c++?

#include "plugin.h"
#include "CCamera.h"

bool camraPosSet = false;

using namespace plugin;

class PluginSdkProject4 {
public:
    PluginSdkProject4() {
		Events::gameProcessEvent += [] {
			CPed *playa = FindPlayerPed();
			if (playa) {
				CVector playaPos = playa->GetPosition();
				CVector camraPos;	CVector camraRotation; 
				camraPos.x = playaPos.x + 0.0f;
				camraPos.y = playaPos.y - 20.0f;
				camraPos.z = playaPos.z + 30.0f;
				camraRotation.x = 0.0f;
				camraRotation.y = 0.0f;
				camraRotation.z = 0.0f;

				TheCamera.SetCamPositionForFixedMode(&camraPos, &camraRotation);	//	0x15F
				TheCamera.TakeControlNoEntity(&playaPos, SWITCHTYPE_JUMPCUT, 1);	//	0x160
			}
		};
    }
} pluginSdkProject4;

Basicly the code does this:

00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
0@ += 0.0
1@ += -20.0
2@ += 30.0
015F: set_camera_position 0@ 1@ 2@ rotation 0.0 0.0 0.0
00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
0160: set_camera_point_at 0@ 1@ 2@ switchstyle 2

 

Link to comment
https://gtaforums.com/topic/975916-sa-cam-pos-ld/#findComment-1071649402
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.