How to auto exit camera after completing the intro :(
#1

Hello everybody
I'm bad ENG sr

How to auto exit camera in intro after completing the intro
Please help me
Код:
// By adri1.

#include <a_samp>
#pragma tabsize 0
main();
new StepSpawnPlayer[MAX_PLAYERS];
new Text:roleplaybox;
new PlayerText:roleplay[MAX_PLAYERS];
forward OnPlayerFinishInterpolateCamera(playerid, type);

public OnFilterScriptInit()
{
        SetGameModeText("Test");
        AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

        roleplaybox = TextDrawCreate(205.212234, 372.750000, "-");
        TextDrawLetterSize(roleplaybox, 15.362092, 1.419166);
        TextDrawAlignment(roleplaybox, 1);
        TextDrawColor(roleplaybox, -1);
        TextDrawSetShadow(roleplaybox, 0);
        TextDrawSetOutline(roleplaybox, 2);
        TextDrawBackgroundColor(roleplaybox, 51);
        TextDrawFont(roleplaybox, 1);
        TextDrawSetProportional(roleplaybox, 1);
        return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
        for(new i = 0; i != 32; i++) SendClientMessage(playerid, -1, " ");
        SpawnPlayer(playerid);
        StepSpawnPlayer[playerid] = 1;
        return 1;
}
public OnPlayerConnect(playerid)
{
    StepSpawnPlayer[playerid] = 0;

    roleplay[playerid] = CreatePlayerTextDraw(playerid, 317.188934, 349.999725, "V");
        PlayerTextDrawLetterSize(playerid, roleplay[playerid], 0.586340, 3.052500);
        PlayerTextDrawAlignment(playerid, roleplay[playerid], 2);
        PlayerTextDrawColor(playerid, roleplay[playerid], -1);
        PlayerTextDrawSetShadow(playerid, roleplay[playerid], -258);
        PlayerTextDrawSetOutline(playerid, roleplay[playerid], 0);
        PlayerTextDrawBackgroundColor(playerid, roleplay[playerid], -2139062017);
        PlayerTextDrawFont(playerid, roleplay[playerid], 1);
        PlayerTextDrawSetProportional(playerid, roleplay[playerid], 1);
        return 1;
}

public OnPlayerSpawn(playerid)
{
        if(StepSpawnPlayer[playerid] == 1)
        {
            TogglePlayerSpectating(playerid, 1);
            SetPlayerPos(playerid, 155.3337, -1776.4384, 14.8978+5.0);
            TogglePlayerControllable(playerid, false);
            PlayAudioStreamForPlayer(playerid, "http://mp3.zing.vn/download/song/Freakshow-DJ-Blend/ZnJnTLmszLlZFFJyZbJyDGZn");
            SetPlayerCameraPos(playerid, 155.3337, -1776.4384, 14.8978);
                SetPlayerCameraLookAt(playerid, 156.2734, -1776.0850, 14.2128);
                InterpolateCameraLookAt(playerid, 156.2734, -1776.0850, 14.2128, 156.2713, -1776.0797, 14.7078, 5000, CAMERA_MOVE);
                SetTimerEx("OnPlayerFinishInterpolateCamera", 5000-600, 0, "id", playerid, 0);
                PlayerTextDrawShow(playerid, roleplay[playerid]);
                for(new i = 0; i != 32; i++) SendClientMessage(playerid, -1, " ");
        }
        return 1;
}

public OnPlayerFinishInterpolateCamera(playerid, type)
{
        switch(type)
        {
            case 0:
                {
                    InterpolateCameraPos(playerid, 187.600982, -1791.727050, 119.087432, 193.731567, -1789.235473, 118.845245, 5000);
                        InterpolateCameraLookAt(playerid, 189.006942, -1790.279785, 114.512641, 195.057144, -1788.512817, 114.078620, 5000);
                        SetTimerEx("OnPlayerFinishInterpolateCamera", 5000-600, 0, "id", playerid, 1);
                        PlayerTextDrawSetString(playerid, roleplay[playerid], "Viet");
                        for(new i = 0; i != 32; i++) SendClientMessage(playerid, -1, " ");
                }
                case 1:
                {
                    InterpolateCameraPos(playerid, 300.803771, -1753.841796, 59.482250, 332.887237, -1753.466674, 60.534908, 4000);
                        InterpolateCameraLookAt(playerid, 302.467315, -1749.504394, 57.633026, 334.005126, -1748.907470, 58.813385, 4000);
                        SetTimerEx("OnPlayerFinishInterpolateCamera", 4000-600, 0, "id", playerid, 2);
                        PlayerTextDrawSetString(playerid, roleplay[playerid], "VietNam");
                        for(new i = 0; i != 32; i++) SendClientMessage(playerid, -1, " ");
                }
                case 2:
                {
                    InterpolateCameraPos(playerid, 350.840972, -1794.716308, 13.146982, 346.193756, -1800.415649, 10.697548, 8000);
                        InterpolateCameraLookAt(playerid, 348.053558, -1790.653564, 12.295993, 342.141357, -1797.657592, 9.712170, 8000);
                        SetTimerEx("OnPlayerFinishInterpolateCamera", 8000-600, 0, "id", playerid, 3);
                        PlayerTextDrawSetString(playerid, roleplay[playerid], "VietNam Role");
                        for(new i = 0; i != 32; i++) SendClientMessage(playerid, -1, " ");
                }
                case 3:
                {
                    InterpolateCameraPos(playerid, 169.602859, -1775.647705, 6.933395, 169.617141, -1776.156250, 12.790164, 5000);
                        InterpolateCameraLookAt(playerid, 169.547332, -1770.651367, 7.117267, 169.588928, -1771.159301, 12.618641, 5000);
                        SetTimerEx("OnPlayerFinishInterpolateCamera", 5000-600, 0, "id", playerid, 4);
                        PlayerTextDrawSetString(playerid, roleplay[playerid], "VietNam Roleplay");
                        for(new i = 0; i != 32; i++) SendClientMessage(playerid, -1, " ");
                }
                case 4:
                {
                    InterpolateCameraPos(playerid, 550.013793, -1772.057128, 16.024028, 552.169799, -1772.079223, 16.285087, 5000);
                        InterpolateCameraLookAt(playerid, 546.803894, -1768.331054, 15.122734, 548.959899, -1768.353149, 15.383792, 5000);
                        SetTimerEx("OnPlayerFinishInterpolateCamera", 5000-600, 0, "id", playerid, 5);
                        TextDrawShowForPlayer(playerid, roleplaybox);
                        for(new i = 0; i != 32; i++) SendClientMessage(playerid, -1, " ");
                }
        }
}
Full code here (Share here https://sampforum.blast.hk/showthread.php?tid=465737)
Reply


Messages In This Thread
How to auto exit camera after completing the intro :( - by quochuy7915 - 24.11.2014, 09:33
Re: How to auto exit camera after completing the intro :( - by quochuy7915 - 24.11.2014, 09:38
Re: How to auto exit camera after completing the intro :( - by quochuy7915 - 24.11.2014, 10:02

Forum Jump:


Users browsing this thread: 1 Guest(s)