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

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.