SA-MP Forums Archive
Camera move doesn't work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Camera move doesn't work (/showthread.php?tid=649822)



Camera move doesn't work - IndependentGaming - 15.02.2018

Hello, I'm trying to make the camera move on the login screen but it doesn't move at all see screenshot:


https://i.imgur.com/Y9Aod30.png



Her is the code:

PHP Code:
case 1:
        {
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,2229.4968,-1722.0701,13.5625);
            
SetPlayerPos(playerid,2211.1460,-1748.3909,-10.0);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        } 



Re: Camera move doesn't work - Fratello - 15.02.2018

Code:
TogglePlayerSpectating(playerid, 1);
InterpolateCameraPos(playerid, 1507.647216, -1675.555664, 43.950473, 1687.330566, -1848.255737, 42.262893, 2, CAMERA_MOVE); 
InterpolateCameraLookAt(playerid, 1511.929809, -1675.608154, 41.370418, 1690.043334, -1851.658691, 39.800899, 2, CAMERA_MOVE);
You don't need anything else in order to run the InterpolateCameraPos function. Also are you 100% sure that 'case 1' will trigger it?


Re: Camera move doesn't work - IndependentGaming - 15.02.2018

Quote:
Originally Posted by Fratello
View Post
Code:
TogglePlayerSpectating(playerid, 1);
InterpolateCameraPos(playerid, 1507.647216, -1675.555664, 43.950473, 1687.330566, -1848.255737, 42.262893, 2, CAMERA_MOVE); 
InterpolateCameraLookAt(playerid, 1511.929809, -1675.608154, 41.370418, 1690.043334, -1851.658691, 39.800899, 2, CAMERA_MOVE);
You don't need anything else in order to run the InterpolateCameraPos function. Also are you 100% sure that 'case 1' will trigger it?
I have add TogglePlayerSpectating to every case and this is what I get ?

https://imgur.com/a/OWaMV


Re: Camera move doesn't work - RogueDrifter - 15.02.2018

Wait why are you even using TogglePlayerSpectating?


Re: Camera move doesn't work - Fratello - 15.02.2018

Put the code above after you display the login dialog.


Re: Camera move doesn't work - Fratello - 15.02.2018

Quote:
Originally Posted by RogueDrifter
View Post
Wait why are you even using TogglePlayerSpectating?
Otherwise (building) textures would not appear properly.


Re: Camera move doesn't work - RogueDrifter - 15.02.2018

I don't know really... i never tried spectate + interp cam (it seemed to cause problems to the OP as well *white-screen* ) ,

this may seem random but remove the 'streamer_updateEx' and try again this is the only code line i see that could make a change i guess?


Re: Camera move doesn't work - IndependentGaming - 15.02.2018

Quote:
Originally Posted by RogueDrifter
View Post
Wait why are you even using TogglePlayerSpectating?
I dont know ?


See whole code:


PHP Code:
stock SetPlayerJoinCamera(playerid)
{
    new 
randcamera Random(1,9);
    switch(
randcamera)
    {                                                                    
        case 
1// Gym
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,1507.647216, -1675.55566443.950473);
            
TogglePlayerSpectating(playerid1);
            
SetPlayerPos(playerid,1507.647216, -1675.55566443.950473);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        }
        case 
2// Paintball Arena
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,1507.647216, -1675.55566443.950473);
            
TogglePlayerSpectating(playerid1);
            
SetPlayerPos(playerid,1507.647216, -1675.55566443.950473);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        }
        case 
3// LSPD
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,1507.647216, -1675.55566443.950473);
            
TogglePlayerSpectating(playerid1);
            
SetPlayerPos(playerid,1507.647216, -1675.55566443.950473);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        }
        case 
4// SaC HQ (Gang HQ)
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,1507.647216, -1675.55566443.950473);
            
TogglePlayerSpectating(playerid1);
            
SetPlayerPos(playerid,1507.647216, -1675.55566443.950473);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        }
        case 
5// Fishing Pier
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,1507.647216, -1675.55566443.950473);
            
TogglePlayerSpectating(playerid1);
            
SetPlayerPos(playerid,1507.647216, -1675.55566443.950473);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        }
        case 
6// VIP
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,1507.647216, -1675.55566443.950473);
            
TogglePlayerSpectating(playerid1);
            
SetPlayerPos(playerid,1507.647216, -1675.55566443.950473);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        }
        case 
7// All Saints
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,1507.647216, -1675.55566443.950473);
            
TogglePlayerSpectating(playerid1);
            
SetPlayerPos(playerid,1507.647216, -1675.55566443.950473);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        }
        case 
8// Unity
        
{
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid,1507.647216, -1675.55566443.950473);
            
TogglePlayerSpectating(playerid1);
            
SetPlayerPos(playerid,1507.647216, -1675.55566443.950473);
            
InterpolateCameraPos(playerid1507.647216, -1675.55566443.9504731687.330566, -1848.25573742.2628932CAMERA_MOVE);
            
InterpolateCameraLookAt(playerid1511.929809, -1675.60815441.3704181690.043334, -1851.65869139.8008992CAMERA_MOVE);
        }
    }
    return 
1;

No matter what I change I changed a few cases with cordinates and still once on the login screen it keeps freeze on blueberry


Re: Camera move doesn't work - IndependentGaming - 15.02.2018

Quote:
Originally Posted by RogueDrifter
View Post
I don't know really... i never tried spectate + interp cam (it seemed to cause problems to the OP as well *white-screen* ) ,

this may seem random but remove the 'streamer_updateEx' and try again this is the only code line i see that could make a change i guess?
I removed the streamer_updateEx but it still freezes in blueberry


Re: Camera move doesn't work - AlexMSK - 15.02.2018

why do you need this
PHP Code:
new randcamera Random(1,9); 
while you can simply do it
PHP Code:
switch(random(9)) 
and try removing return 1; sometimes it mess things up.