SA-MP Forums Archive
Move camera to certain locations(no code - yet...) - 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: Move camera to certain locations(no code - yet...) (/showthread.php?tid=495113)



Move camera to certain locations(no code - yet...) - SwisherSweet - 16.02.2014

Ok so for my server OnPlayerRequestClass I want the camera's blinking from place to player example, For 5 Seconds it's on 1 Place then it goes to another...
Anyways can someone give me some function call backs or whatever to do this, I will make it myself if no one will make it for me, I just need somewhere to start...


Re: Move camera to certain locations(no code - yet...) - GODEX - 16.02.2014

Here you go hopefully this helps;

This will switch your camera location from place to place while the person is either logining in or registering.

Код:
new Testing[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)
{
    Testing[playerid] = 1;
    if(Testing[playerid] == 1)
    {
           TogglePlayerSpectating(playerid, 1);
           InterpolateCameraPos(playerid, 0.0, 0.0, 10.0, 1000.0, 1000.0, 30.0, 10000, CAMERA_MOVE);
           InterpolateCameraLookAt(playerid, 50.0, 50.0, 10.0, -50.0, 50.0, 10.0, 10000, CAMERA_MOVE);
	   SetTimerEx("NextStep1", 5000, false, "i", playerid);
    }
    else if(Testing[playerid] == !1) return 1;
    return 1;
}

forward NextStep1(playerid);
public NextStep1(playerid)
{
    InterpolateCameraPos(playerid, 0.0, 0.0, 10.0, 1000.0, 1000.0, 30.0, 10000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 50.0, 50.0, 10.0, -50.0, 50.0, 10.0, 10000, CAMERA_MOVE);
	SetTimerEx("NextStep2", 5000, false, "i", playerid);
}

forward NextStep2(playerid);
public NextStep2(playerid)
{
    InterpolateCameraPos(playerid, 0.0, 0.0, 10.0, 1000.0, 1000.0, 30.0, 10000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 50.0, 50.0, 10.0, -50.0, 50.0, 10.0, 10000, CAMERA_MOVE);
    Testing[playerid] = 0;
}