Jump to content
RAGE Multiplayer Community

Reset Camera


#Patow
 Share

Recommended Posts

Hi, i have this script:

 

var loginBrowser = mp.browsers.new('package://Login/login.html');
var activeCam = true;
let sceneryCamera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40);

sceneryCamera.pointAtCoord(402.8664, -996.4108, -98.5); //Changes the rotation of the camera to point towards a location
sceneryCamera.setActive(activeCam);
mp.game.cam.renderScriptCams(activeCam, false, 0, true, false);

mp.events.add('loginInformationToServer', (usuario, contraseña) => {
	activeCam = false;
    mp.events.callRemote('OnPlayerLoginAttempt', usuario, contraseña);
});

 

I need, after the player logued in the server the camera back to the player again.

 

loginInformationToServer is called when the player logged in.

 

Thanks!

Link to comment
Share on other sites

2 hours ago, #Patow said:

mp.events.add('loginInformationToServer', (usuario, contraseña) => { activeCam = false; mp.events.callRemote('OnPlayerLoginAttempt', usuario, contraseña); });

mp.events.add('loginInformationToServer', (usuario, contraseña) => {
	activeCam = false;
   	if (sceneryCamera !== null)
    	sceneryCamera.setActive(activeCam);
    mp.game.cam.renderScriptCams(false, true, 2000, true, false);
	mp.events.callRemote('OnPlayerLoginAttempt', usuario, contraseña);
});

Takes 2 transition to return back to your player.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
On 1/16/2019 at 5:52 PM, Captien said:
mp.events.add('loginInformationToServer', (usuario, contraseña) => {
	activeCam = false;
   	if (sceneryCamera !== null)
    	sceneryCamera.setActive(activeCam);
    mp.game.cam.renderScriptCams(false, true, 2000, true, false);
	mp.events.callRemote('OnPlayerLoginAttempt', usuario, contraseña);
});

Takes 2 transition to return back to your player.

Thanks brother but still not working for me.

Now the camera dont move from spawn place.

Link to comment
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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...