29.09.2016, 03:35
I am trying to make a camera movement.. I want it to change camera positions every specific time.
I had added some beta client messages like CAM1, CAM2, etc..
When i am using it it prints:
Around 1 second..
So what really happens is that it ignores every case and is going straight a the 5th.
I had added some beta client messages like CAM1, CAM2, etc..
When i am using it it prints:
Код:
CAM1 CAM2 CAM3 CAM4 CAM5
So what really happens is that it ignores every case and is going straight a the 5th.
PHP код:
else
{
ShowRegisterScreen(playerid);
pinfo[playerid][Banned] = 0;
CameraMovement[playerid] = 1;
ConnectionCamera[playerid] = SetTimerEx("ConnectionCameraMovement", 1000, 0, "i", playerid);
}
PHP код:
function ConnectionCameraMovement(playerid)
{
TogglePlayerSpectating(playerid, 1);
switch(CameraMovement[playerid])
{
case 1:
{
SendClientMessage(playerid, -1, "CAM1");
InterpolateCameraPos(playerid, 1977.940917, -1753.394165, 15.710048, 1683.647583, -1725.149780, 15.520676, 13000);
InterpolateCameraLookAt(playerid, 1972.946899, -1753.489624, 15.485646, 1688.493530, -1726.381225, 15.500365, 2000);
ConnectionCamera[playerid] = SetTimerEx("ConnectionCameraMovement", 15000, false, "i", playerid);
CameraMovement[playerid] = 2;
}
case 2:
{
SendClientMessage(playerid, -1, "CAM2");
InterpolateCameraPos(playerid, 905.286132, -1403.625976, 15.154844, 1353.317626, -1404.655395, 15.989136, 10000);
InterpolateCameraLookAt(playerid, 910.276306, -1403.326171, 15.062310, 1349.223632, -1401.786621, 15.892268, 2000);
ConnectionCamera[playerid] = SetTimerEx("ConnectionCameraMovement", 12000, false, "i", playerid);
CameraMovement[playerid] = 3;
}
case 3:
{
SendClientMessage(playerid, -1, "CAM3");
InterpolateCameraPos(playerid, 1584.561767, -1731.501708, 14.498149, 1334.697753, -1722.911621, 15.104587, 10000);
InterpolateCameraLookAt(playerid, 1579.567993, -1731.750732, 14.477837, 1338.359619, -1726.315917, 15.058754, 2000);
KillTimer(ConnectionCamera[playerid]);
ConnectionCamera[playerid] = SetTimerEx("ConnectionCameraMovement", 12000, false, "i", playerid);
CameraMovement[playerid] = 4;
}
case 4:
{
SendClientMessage(playerid, -1, "CAM4");
InterpolateCameraPos(playerid, 165.131668, -1885.581787, 1.454522, 636.477600, -1918.955688, 5.688834, 10000);
InterpolateCameraLookAt(playerid, 170.110122, -1885.167968, 1.663836, 631.661071, -1917.679565, 5.273429, 2000);
ConnectionCamera[playerid] = SetTimerEx("ConnectionCameraMovement", 12000, false, "i", playerid);
CameraMovement[playerid] = 5;
}
case 5:
{
SendClientMessage(playerid, -1, "CAM5");
InterpolateCameraPos(playerid, 1828.909790, -1602.995971, 13.485791, 1857.642089, -1431.320312, 16.744033, 10000);
InterpolateCameraLookAt(playerid, 1825.495117, -1599.407348, 14.165193, 1852.764038, -1432.402221, 16.557880, 2000);
ConnectionCamera[playerid] = SetTimerEx("ConnectionCameraMovement", 12000, false, "i", playerid);
CameraMovement[playerid] = 1;
}
}
return 1;
}