SA-MP Forums Archive
Help, End "InterpolateCameraPos" - 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: Help, End "InterpolateCameraPos" (/showthread.php?tid=582628)



Help, End "InterpolateCameraPos" - TheSkyBlueTeam - 22.07.2015

Hello Everyone. I need your help, I use this cameditor filterscript to create cinematic shots for my upcoming SA:MP video. Long story short, I use a command to load the cinematic camera i.e "/a1cam". Everything works fine, its just that I don't know how to end it.

The shot is 5 seconds long (5000 M.seconds), I added SetCameraBehindPlayer(playerid); under the command, but that didn't fix it. So how do I reset the camera to the player after the cinematic shot is done?

Code:

if (strcmp("/a1cam", cmdtext, true, 10) == 0)
{
TogglePlayerSpectating(playerid, 1);
InterpolateCameraPos(playerid, -2256.687500, -1802.869628, 422.829467, -2235.892089, -1764.994384, 422.829467, 5000);
InterpolateCameraLookAt(playerid, -2258.667968, -1799.940795, 426.364990, -2239.415039, -1765.469116, 426.345611, 5000);
return 1;

Thanks!

Picture from the cinematic shot here:


Re: Help, End "InterpolateCameraPos" - DarkLored - 22.07.2015

TogglePlayerSpectating(playerid, 0); then use the SetCameraBehindPlayer.


Re: Help, End "InterpolateCameraPos" - SickAttack - 22.07.2015

Putting them in spectating mode will most likely require you to remove them from such:
pawn Код:
TogglePlayerSpectating(playerid, false);



Re: Help, End "InterpolateCameraPos" - TheSkyBlueTeam - 22.07.2015

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Putting them in spectating mode will most likely require you to remove them from such:
pawn Код:
TogglePlayerSpectating(playerid, false);
Like this?

if (strcmp("/a1cam", cmdtext, true, 10) == 0)
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
InterpolateCameraPos(playerid, -2256.687500, -1802.869628, 422.829467, -2235.892089, -1764.994384, 422.829467, 5000);
InterpolateCameraLookAt(playerid, -2258.667968, -1799.940795, 426.364990, -2239.415039, -1765.469116, 426.345611, 5000);
return 1;
}


Re: Help, End "InterpolateCameraPos" - DarkLored - 22.07.2015

No set a timer that will count 5000 mili seconds after the command is performed and then use what we have given to you.


Re: Help, End "InterpolateCameraPos" - SickAttack - 22.07.2015

Quote:
Originally Posted by TheSkyBlueTeam
Посмотреть сообщение
Like this?

if (strcmp("/a1cam", cmdtext, true, 10) == 0)
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
InterpolateCameraPos(playerid, -2256.687500, -1802.869628, 422.829467, -2235.892089, -1764.994384, 422.829467, 5000);
InterpolateCameraLookAt(playerid, -2258.667968, -1799.940795, 426.364990, -2239.415039, -1765.469116, 426.345611, 5000);
return 1;
}
No, when their camera finishes moving.


Re: Help, End "InterpolateCameraPos" - TheSkyBlueTeam - 22.07.2015

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
No set a timer that will count 5000 mili seconds after the command is performed and then use what we have given to you.
How do I write that code, im a noob as u can tell


Re: Help, End "InterpolateCameraPos" - DarkLored - 22.07.2015

Here is a wiki link that explains how to use timers

https://sampwiki.blast.hk/wiki/SetTimerEx


Re: Help, End "InterpolateCameraPos" - TheSkyBlueTeam - 22.07.2015

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Here is a wiki link that explains how to use timers

https://sampwiki.blast.hk/wiki/SetTimerEx
Thanks


Re: Help, End "InterpolateCameraPos" - TheSkyBlueTeam - 22.07.2015

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Here is a wiki link that explains how to use timers

https://sampwiki.blast.hk/wiki/SetTimerEx
Nope, It didn't work.

if (strcmp("/a1cam", cmdtext, true, 10) == 0)
{
InterpolateCameraPos(playerid, -2256.687500, -1802.869628, 422.829467, -2235.892089, -1764.994384, 422.829467, 5000);
InterpolateCameraLookAt(playerid, -2258.667968, -1799.940795, 426.364990, -2239.415039, -1765.469116, 426.345611, 5000);
SetCameraBehindPlayer(playerid);
TogglePlayerSpectating(playerid, false);
SetTimerEx("CinematicTimer", 5000, false,"i",playerid);