Tutorial - Question on how to make it
#1

'Sup y'all?

I've got a question; what would I need to do if I want to script a command for a tutorial? I mean, whenever a player performed this command, he will see pictures from places of my gamemode and under them will be text (probably with textdraws). After 10 seconds for example, the picture would change to another one then. It'd be done with timers then. How to script such a command?
Reply
#2

pictures from your gm?

what do you mean?

i guess you could put them in spectate and
setup the cam for the "pictures" you want to show,
and change the cam every 10 secs with a timer.
Reply
#3

With 'pictures' I simply mean places from my gamemode, like the LS stadium. I'd need a little kick for starting it, so an example would be really appreciated!
Reply
#4

Small bump.
Reply
#5

When player types the command, set the camera to look at a specific position (e.g. the stadium by using)

https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt
https://sampwiki.blast.hk/wiki/SetPlayerCameraPos

and then create a timer, that changes the cordinates after 10 minutes (and the text)
Reply
#6

Quote:
Originally Posted by spedico
Посмотреть сообщение
When player types the command, set the camera to look at a specific position (e.g. the stadium by using)

https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt
https://sampwiki.blast.hk/wiki/SetPlayerCameraPos

and then create a timer, that changes the cordinates after 10 minutes (and the text)
That is the part I don't get; shall I create a new callback and kill the timer each time in it?
Reply
#7

I'd do it this way. I am not sure if it works or not, but it should. Feel free to adjust and try it.

pawn Код:
new CurrentStage[MAX_PLAYERS];
new PTT[MAX_PLAYERS]; // player tutorial timer
forward NextStage(playerid);

stock PlayerTutorial(playerid, stage)
{
    switch(stage)
    {
        case 0:
        {
            SetPlayerCameraLookAt(playerid, 0, 0, 0);
            SetPlayerCameraPos(playerid, 0, 0, 0);
            SendClientMessage(playerid, -1, "part 1: blabalablalbala");
            CurrentStage[playerid] = 0;
        }
        case 1:
        {
            SetPlayerCameraLookAt(playerid, 0, 0, 0);
            SetPlayerCameraPos(playerid, 0, 0, 0);
            SendClientMessage(playerid, -1, "part 2: blabalablalbala");
            CurrentStage[playerid] = 1;
        }
    }
}

stock RunTutorial(playerid)
{
    PlayerTutorial(playerid, 0);
    PTT[playerid] = SetTimerEx("NextStage", 10000, 1, "%d", playerid);
}

command(tutorial, playerid, params[])
{
    RunTutorial(playerid);
    return 1;
}

public NextStage(playerid)
{
    new Stage = CurrentStage[playerid] + 1;
    if(Stage >= 2) // if stage is 2 or over 2, kill the timer (there's just 2 stages in the example, starting from 0)
    {
        KillTimer(PTT[playerid]);
        SendClientMessage(playerid, -1, "you have finished the tutorial.");
    }
    else
    {
        PlayerTutorial(playerid, Stage);
    }
    return 1;
}
Reply
#8

Just do something like;

pawn Код:
new TutStage [ MAX_PLAYERS ] = 0;

[INSIDE OF THE TIMER]

if( TutStage[playerid] == 0 )
{
//Start the tutorial...
TutStage[playerid]++;
}

else if(TutStage[playerid] == 1 )
{
//Next Stage..
TutStage[playerid]++;
}
You could also use a switch statement to make it faster.
Reply
#9

LetterBox mode will be good for you:
[FS] Letterbox Mode
Reply
#10

Thank y'all guys, now I've got a little problem; the places look in the /tutorial too bad, all the textures are gone! Look at the picture. Did I do this right by setting both Camera functions to the same value?

PHP код:
stock PlayerTutorial(playeridstage)
{
    switch(
stage)
    {
        case 
0:
        {
            
SetPlayerCameraLookAt(playerid2442.1577,-1660.6066,27.4470);
            
SetPlayerCameraPos(playerid2442.1577,-1660.6066,27.4470);
            
SendClientMessage(playerid, -1"part 1: blabalablalbala");
            
CurrentStage[playerid] = 0;
        }
        case 
1:
        {
            
SetPlayerCameraLookAt(playerid2384.9014,-1667.0778,13.5469);
            
SetPlayerCameraPos(playerid2384.9014,-1667.0778,13.5469);
            
SendClientMessage(playerid, -1"part 2: blabalablalbala");
            
CurrentStage[playerid] = 1;
        }
    }

Second problem: The player can see the map and the chat. How to hide them in the tutorial except "TogglePlayerControllable" for the player?

By the way, thanks y'all, I gave y'all reputation!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)