SA-MP Forums Archive
[Ajuda] Como fazer um tutorial quando connectar? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Como fazer um tutorial quando connectar? (/showthread.php?tid=462087)



Como fazer um tutorial quando connectar? - Wevelly - 05.09.2013

Queria saber como faz tutorial em SendClientMessage com um intervalo de tempo para mudar para outra frase, exemplo:

Esse servidor й RP, bla, bla, bla, daн teria um intervalo de 1 minuto por exemplo e mudaria para outra fase.


Re: Como fazer um tutorial quando connectar? - mau.tito - 05.09.2013

SetTimerEx + Variavel


Re: Como fazer um tutorial quando connectar? - Wevelly - 06.09.2013

Bom, depois de umas 2 horas quebrando a cabeзa(Nгo sei porque... Estava pensando como й que faria) eu finalmente consegui, mas estou aqui pensando, para cada parte do tutorial terei criar mais forward para usar no SetTimer, tem alguma forma mais simples de fazer isso?

PHP код:
forward Tutorial1(playerid);
forward Tutorial2(playerid); // Topo GM
public Tutorial1(playerid)
{
    new 
Tutorial1[100] =
    {
        
"OIIIIIIIIIIIII"
    
};
    
SendClientMessage(playeridTesteTutorial1);
    return 
1;
}
public 
Tutorial2(playerid)
{
    new 
Tutorial2[100] =
    {
        
"OIIIIIIII2"
    
};
    
SendClientMessage(playeridTesteTutorial22);
    return 
1;
// Funзхes para o SetTimer
public OnPlayerSpawn(playerid)
{
    
SetTimer("Tutorial1"100false);
    
SetTimer("Tutorial2"3000false); //Esse tempo estou usando como exemplo no meu teste, sу para saber se funcionou
    
return 1;




Re: Como fazer um tutorial quando connectar? - PT - 06.09.2013

prefiro usar algo assim

pawn Код:
// junto com as outras forward
forward tuto(playerid);
forward tuto1(playerid);
forward tuto2(playerid);
forward tuto3(playerid);

// fim da gm
public tuto(playerid)
{
    SendClientMessage(playerid, -1, "sou");

    SetTimerEx("tuto1", 5000, 0, "e", playerid);
    return 1;
}

public tuto1(playerid)
{
    SendClientMessage(playerid, -1, "muito");

    SetTimerEx("tuto2", 5000, 0, "e", playerid);
    return 1;
}

public tuto2(playerid)
{
    SendClientMessage(playerid, -1, "lindo");
   
    SetTimerEx("tuto3", 5000, 0, "e", playerid);
    return 1;
}

public tuto3(playerid)
{
    SendClientMessage(playerid, -1, "oi");
    return 1;
}
para comecar o tutorial basta usar

pawn Код:
tuto(playerid);
que pode ser usada por exemplo assim

pawn Код:
CMD:teste(playerid)
{
    tuto(playerid);
    return 1;
}



Re: Como fazer um tutorial quando connectar? - willttoonn - 06.09.2013

Quote:
Originally Posted by PT
Посмотреть сообщение
prefiro usar algo assim

pawn Код:
// junto com as outras forward
forward tuto(playerid);
forward tuto1(playerid);
forward tuto2(playerid);
forward tuto3(playerid);

// fim da gm
public tuto(playerid)
{
    SendClientMessage(playerid, -1, "sou");

    SetTimerEx("tuto1", 5000, 0, "e", playerid);
    return 1;
}

public tuto1(playerid)
{
    SendClientMessage(playerid, -1, "muito");

    SetTimerEx("tuto2", 5000, 0, "e", playerid);
    return 1;
}

public tuto2(playerid)
{
    SendClientMessage(playerid, -1, "lindo");
   
    SetTimerEx("tuto3", 5000, 0, "e", playerid);
    return 1;
}

public tuto3(playerid)
{
    SendClientMessage(playerid, -1, "oi");
    return 1;
}
para comecar o tutorial basta usar

pawn Код:
tuto(playerid);
que pode ser usada por exemplo assim

pawn Код:
CMD:teste(playerid)
{
    tuto(playerid);
    return 1;
}
O tutorial que estou pensando em fazer й dessa maneira ai


Re: Como fazer um tutorial quando connectar? - Coe1 - 06.09.2013

pawn Код:
new EtapaTuto[ MAX_PLAYERS ];

forward Tutorial(playerid);


public OnPlayerSpawn(playerid)
{
    SetTimer("Tutorial", 100, false);
    EtapaTuto[ playerid ] = 1;
    return 1;
}  

public Tutorial(playerid)
{
    if(EtapaTuto[ playerid ] == 1)
    {
        SendClientMessage(playerid, -1, "Tutorial etapa: 1");
        EtapaTuto[ playerid ] = 2;
       
    }
    else if(EtapaTuto[ playerid ] == 2)
    {
        SendClientMessage(playerid, -1, "Tutorial etapa: 2");
        EtapaTuto[ playerid ] = 3;
    }
    else if(EtapaTutp[ playerid ] == 3)
    {
        SendClientMessage(playerid, -1, "Tutorial etapa: 3");
        EtapaTuto[ playerid ] = 4;     
    }
    else if(EtapaTuto[ playerid ] == 4)
    {
        SendClientMessage(playerid, -1, "Tutorial etapa: 4");
        EtapaTuto[ playerid ] = 5;
    }
    else if(EtapaTuto[ playerid ] == 5)
    {
        SendClientMessage(playerid, -1, "Tutorial etapa: 5");
        EtapaTuto[ playerid ] = 0;     
    }
   
    return 1;
}