#1

I have a problem, because i did five positions:
Код:
new MAX_CAMERAS[5];
new Float:CameraSkinSelection[MAX_CAMERAS][6] =
{
	{-1265.975952, 965.073181, 136.339904, -1279.604614, 970.440979, 141.554534}, // A
	{-1279.604614, 970.440979, 141.554534, -1272.550659, 980.745117, 140.219543}, // B
	{-1272.550659, 980.745117, 140.219543, -1281.705688, 970.184082, 139.713088}, // C
	{-1281.705688, 970.184082, 139.713088, -1271.078613, 976.697021, 143.956420}, // D
	{-1265.975952, 965.073181, 136.339904, -1279.604614, 970.440979, 141.554534} // E
};
And i can't do loop for() which will be made ​​for this to be the first camera A then B, C, D, E, and then from the beginning. I did it:
Код:
for(new x = MAX_CAMERAS; x--;)
        {
			InterpolateCameraPos(playerid, CameraSkinSelection[x][0], CameraSkinSelection[x][1], CameraSkinSelection[x][2], CameraSkinSelection[x][3], CameraSkinSelection[x][4], CameraSkinSelection[x][5], 2000, 1);
            InterpolateCameraLookAt(playerid, -1279.157348, 969.061645, 140.653335, -1269.364379, 976.686645, 141.089126, 2000, 1);
        }
but it doesn't work.
Reply
#2

Change:
pawn Код:
new MAX_CAMERAS[5];

To:

pawn Код:
#define MAX_CAMERAS 5
and for loop has three rules.
  • Initialisation.
  • Condition.
  • Incrementation.
Change:
pawn Код:
for(new x = MAX_CAMERAS; x--)
To:
pawn Код:
for(new x = 5;x <= 0; x--)
Reply
#3

I'm sorry. I gave the wrong code. Yes i have this in my script.
Reply
#4

Quote:
Originally Posted by PapaSmerf
Посмотреть сообщение
I'm sorry. I gave the wrong code. Yes i have this in my script.
Post the correct code then! and check the above post for the corrent usage of 'for loop'.
Reply
#5

Now, Camera doesn't move. This is my code:

Код:
#define MAX_CAMERAS 5
new Float:CameraSkinSelection[MAX_CAMERAS][6] =
{
	{-1265.975952, 965.073181, 136.339904, -1279.604614, 970.440979, 141.554534},
	{-1279.604614, 970.440979, 141.554534, -1272.550659, 980.745117, 140.219543},
	{-1272.550659, 980.745117, 140.219543, -1281.705688, 970.184082, 139.713088},
	{-1281.705688, 970.184082, 139.713088, -1271.078613, 976.697021, 143.956420},
	{-1265.975952, 965.073181, 136.339904, -1279.604614, 970.440979, 141.554534}
};


public OnPlayerRequestClass(playerid, classid)
{
	if(PlayerStats[playerid][Logged] == true)
	{
        for(new x = 5;x <= MAX_CAMERAS; x--)
        {
			InterpolateCameraPos(playerid, CameraSkinSelection[x][0], CameraSkinSelection[x][1], CameraSkinSelection[x][2], CameraSkinSelection[x][3], CameraSkinSelection[x][4], CameraSkinSelection[x][5], 2000, 1);
            InterpolateCameraLookAt(playerid, -1279.157348, 969.061645, 140.653335, -1269.364379, 976.686645, 141.089126, 2000, 1);
        }

        SetPlayerPos(playerid, -1278.4835, 976.6465, 139.2304);
        SetPlayerFacingAngle(playerid,-94.0000);
	    
	    PlayerPlaySound(playerid, 1132, -1279.197509, 965.064270, 140.792968);
	    TextDrawShowForPlayer(playerid, WhiteScreen);
	    SetTimerEx("WhiteScreenClass", 100, 0, "d", playerid);
	}
	return 1;
}
Reply
#6

Change this
pawn Код:
for(new x = 5;x <= MAX_CAMERAS; x--)
To
pawn Код:
for(new x = 4;x <= MAX_CAMERAS; x--)
and try again!
Reply
#7

Now, the camera moves from A to B and to camera C, D, E will not. Only moves from A to B. When i click Left/ Right mouse button the camera resets.
Reply
#8

Quote:
Originally Posted by PapaSmerf
Посмотреть сообщение
Now, the camera moves from A to B and to camera C, D, E will not. Only moves from A to B. When i click Left/ Right mouse button the camera resets.
Oww use this!
pawn Код:
for(new x = 5;x >= 0; x--)
Reply
#9

The camera looks at the beaches in Los Santos. The camera doesn't move. Only look at beaches, ehh. When i use your code.
Reply
#10

Quote:
Originally Posted by PapaSmerf
Посмотреть сообщение
The camera looks at the beaches in Los Santos. The camera doesn't move. Only look at beaches, ehh. When i use your code.
Maybe a do while loop can do the task as well as with the right condition!

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(PlayerStats[playerid][Logged] == true)
    {
        new x = 4;
        do
        {
            InterpolateCameraPos(playerid, CameraSkinSelection[x][0], CameraSkinSelection[x][1], CameraSkinSelection[x][2], CameraSkinSelection[x][3], CameraSkinSelection[x][4], CameraSkinSelection[x][5], 2000, 1);
            InterpolateCameraLookAt(playerid, -1279.157348, 969.061645, 140.653335, -1269.364379, 976.686645, 141.089126, 2000, 1);
            x--;
        }
        while(x >= 0)
        SetPlayerPos(playerid, -1278.4835, 976.6465, 139.2304);
        SetPlayerFacingAngle(playerid,-94.0000);

        PlayerPlaySound(playerid, 1132, -1279.197509, 965.064270, 140.792968);
        TextDrawShowForPlayer(playerid, WhiteScreen);
        SetTimerEx("WhiteScreenClass", 100, 0, "d", playerid);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)