SA-MP Forums Archive
Queuing functions - 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: Queuing functions (/showthread.php?tid=375568)



Queuing functions - vIBIENNYx - 07.09.2012

Okay, I want to create a series of "InterpolateCameraPos" and "InterpolateCameraLookAt" functions using timers and textdraws to create cutscenes similar to singleplayer. my question is, do they queue? For Example

pawn Код:
if(cutsceneid == 1)
    {
        TextDrawShowForPlayer(playerid, WIDESCREEN_TOP[playerid]);
        TextDrawShowForPlayer(playerid, WIDESCREEN_BOTTOM[playerid]);
        TogglePlayerSpectating(playerid, 1);
        if(CutsceneScene[playerid] == 0)
        {
            CutsceneScene[playerid] = 1;
            InterpolateCameraPos(playerid, -2170.9817, -400.8776, 130.2300, -2176.4348, 1360.3551, 130.6170, 100000, CAMERA_MOVE);
            InterpolateCameraLookAt(playerid, -2176.4348, 1360.3551, 55.6170, -2176.4348, 1360.3551, 130.6170, 100000, CAMERA_MOVE);
        }
    }
    return 1;
Is my current script for the first scene of a cutscene, how can I add a second set of InterplateCameraPos inside that function? Can I queue them or?


Re: Queuing functions - vIBIENNYx - 07.09.2012

By queue I mean, schedule one function to execute after another one has finished.


Re: Queuing functions - vIBIENNYx - 07.09.2012

I was thinking timers, but how would I create them without having One or two timers per scene. And, what are wrapper functions?


Re: Queuing functions - vIBIENNYx - 07.09.2012

Alright, I've got a way of doing it but it's quite cockhanded, thanks for the help ^^