Sign in to follow this  
#Patow

Reset Camera

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.