Camera pos.
#1

Hello!
I want to make a command like /tour.
Camera will set in 5 different positions.Camera position will change randomly after 5 seconds till the 5th camera position, after that the player will spawn .Can anyone please show me an example code, so that it is easy for me to study.
Reply
#2

Example:

pawn Код:
new TourVariable[MAX_PLAYERS];

forward TourTimer(playerid);

new TourTimerVariable[MAX_PLAYERS];

OnPlayerConnect(playerid)
{
    TourVariable[playerid] = 0;
    return 1;
}

CMD:tour(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        TourTimerVariable[playerid] = SetTimerEx("message", 5000, false, "i", playerid);
        SendClientMessage(playerid, -1, "You are now going through the tour!");
    }
    return 1;
}

public message(playerid)
{
    if(TourVariable[playerid] == 0)
    {
        TourVariable[playerid] = 1;
        //First thing
    }
    if(TourVariable[playerid] == 1)
    {
        TourVariable[playerid] = 2;
        //Second thing
    }
    if(TourVariable[playerid] == 2)
    {
        TourVariable[playerid] = 3;
        //Third thing
    }
    if(TourVariable[playerid] == 3)
    {
        TourVariable[playerid] = 4;
        //Fourth thing
    }
    if(TourVariable[playerid] == 4)
    {
        //Fifth thing
        TourVariable[playerid] = 0;
        KillTimer(TourTimerVariable[playerid]);
    }
    return 1;
}
Hope I helped.
Reply
#3

Quote:
Originally Posted by Kindred
Посмотреть сообщение
Example:

pawn Код:
new TourVariable[MAX_PLAYERS];

forward TourTimer(playerid);

new TourTimerVariable[MAX_PLAYERS];

OnPlayerConnect(playerid)
{
    TourVariable[playerid] = 0;
    return 1;
}

CMD:tour(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        TourTimerVariable[playerid] = SetTimerEx("message", 5000, false, "i", playerid);
        SendClientMessage(playerid, -1, "You are now going through the tour!");
    }
    return 1;
}

public message(playerid)
{
    if(TourVariable[playerid] == 0)
    {
        TourVariable[playerid] = 1;
        //First thing
    }
    if(TourVariable[playerid] == 1)
    {
        TourVariable[playerid] = 2;
        //Second thing
    }
    if(TourVariable[playerid] == 2)
    {
        TourVariable[playerid] = 3;
        //Third thing
    }
    if(TourVariable[playerid] == 3)
    {
        TourVariable[playerid] = 4;
        //Fourth thing
    }
    if(TourVariable[playerid] == 4)
    {
        //Fifth thing
        TourVariable[playerid] = 0;
        KillTimer(TourTimerVariable[playerid]);
    }
    return 1;
}
Hope I helped.
Ok where i have to add SetCameraPos & SetCameraLookAt ?
Reply
#4

Where it says this:

pawn Код:
//First thing
^^ Means first camera position, and so on.
Reply
#5

Quote:
Originally Posted by Kindred
Посмотреть сообщение
Where it says this:

pawn Код:
//First thing
^^ Means first camera position, and so on.
Thank you dude +rep
Reply
#6

Nooo!! it is not working properly, it is showing only the last camera position :S
Please anyone help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)