SA-MP Forums Archive
[Ajuda]Timer. - 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]Timer. (/showthread.php?tid=333404)



[Ajuda]Timer. - Pedro Pawno - 11.04.2012

Bom estou com uma idea a mesma й simples quero saber como posso criar um timer a cada 10 minutos para o player ir a outra tela, ou seja uma SELEЗГO alguem pode me dar uma idea?


Re: [DUV]Timer. - Rick_DR - 11.04.2012

Outra tela ? como assim ?


Re: [DUV]Timer. - Macintosh - 11.04.2012

Se foi o que entendi...

pawn Код:
forward ProxTela(playerid); // Topo do GM.
pawn Код:
SetTimer("ProxTela", 10000, true); // Onde vocк quer que repita.
pawn Код:
public ProxTela(playerid) // Final do GM.
{
   ForceClassSelection(playerid);
   return 1;
}



Respuesta: Re: [DUV]Timer. - Pedro Pawno - 11.04.2012

Quote:
Originally Posted by Macintosh
Посмотреть сообщение
Se foi o que entendi...

pawn Код:
forward ProxTela(playerid); // Topo do GM.
pawn Код:
SetTimer("ProxTela", 10000, true); // Onde vocк quer que repita.
pawn Код:
public ProxTela(playerid) // Final do GM.
{
   ForceClassSelection(playerid);
   return 1;
}

Sim й isso mesmo, porem onde coloco as coordenadas para o player ser setado a cada 10 minuto OnPlayerSpawn?

junto com esse SetTimer("ProxTela", 10000, true); // Onde vocк quer que repita..


Re: [DUV]Timer. - Ricop522 - 11.04.2012

new Class[MAX_PLAYERS];
pawn Код:
Class[playerid]++;
if(Class[playerid] == 1) {
   //setplayerpos(.) setplayercam...
}
if(Class[playerid] == 2) {

}



Respuesta: Re: [DUV]Timer. - Pedro Pawno - 11.04.2012

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
new Class[MAX_PLAYERS];
pawn Код:
Class[playerid]++;
if(Class[playerid] == 1) {
   //setplayerpos(.) setplayercam...
}
if(Class[playerid] == 2) {

}
ou seja quando der 10 minutos ele vai passar pro 2 e quando acabar o do 2 vai pro 1 certo?

dai adiciono, o Pos.. O cуdigo deve ser adicionado em qual callback?


Re: [Ajuda]Timer. - Ricop522 - 11.04.2012

Requestclass + settimer.


Re: [Ajuda]Timer. - zSuYaNw - 11.04.2012

Fiz um tipo de FS, bem explicadinho:
pawn Код:
#include <a_samp>


#define MAX_CAM                             (4)// Coloque aqui o mбximo de cвmeras que irб ter.

new
    iPlayer[MAX_PLAYERS char],
    Float:Locations[MAX_CAM][11] =
    {
/*      {PlayerPosX, PlayerPosY, PlayerPosZ, CamPosX, CamPosY, CamPosZ, LookPosX, LookPosY, LookPosZ, Angle},*/
        {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
        {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
        {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
        {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}
    }
;

public OnPlayerRequestClass(playerid, classid)
{
    /* Setamos a posiзгo do player */
    SetPlayerPos(playerid, Locations[iPlayer{playerid}][0], Locations[iPlayer{playerid}][1], Locations[iPlayer{playerid}][2]);
   
    /* Setamos a posiзгo da cвmera */
    SetPlayerCameraPos(playerid, Locations[iPlayer{playerid}][3], Locations[iPlayer{playerid}][4], Locations[iPlayer{playerid}][5]);
   
    /* Setamos a posiзгo da cвmera LookAt */
    SetPlayerCameraLookAt(playerid, Locations[iPlayer{playerid}][6],Locations[iPlayer{playerid}][7], Locations[iPlayer{playerid}][8]);
   
    /* E por ъltimo, setamos a posiзгo do Angulo */
    SetPlayerFacingAngle(playerid, Locations[iPlayer{playerid}][9]);
    return 1;
}



public OnGameModeInit()
{
    /* Colocaremos o tempo aqui para chama-lo a cada 10 segundos */
    SetTimer("@ProxTela", 10000, true);
    return 1;
}



@ProxTela(); public @ProxTela()
{
    /* Fazemos um looop para percorrer em todos os players */
    for(new i, e = GetMaxPlayers(); i != e; i++){
        /* O players tem que estar conectados */
        if(IsPlayerConnected(i)){
       
            /* Atribui a array iPlayer + 1 */
            iPlayer{i}++;
           
            /* Caso jб estiver no mбximo de cвmeras ele reseta */
            if(iPlayer{i} >= MAX_CAM) iPlayer{i} = 0;
           
            /* Manda para seleзгo de classes  */
            ForceClassSelection(i);
        }
    }
    return 1;
}



Re: [Ajuda]Timer. - Felipe_Wesker - 11.04.2012

Para que serve esse FS Garfield, eu n entendi ainda oque o cara pediu.. Como assim mudar de tela/cameras?


Re: [Ajuda]Timer. - dPlaYer_ - 11.04.2012

Quote:
Originally Posted by Felipe_Wesker
Посмотреть сообщение
Para que serve esse FS Garfield, eu n entendi ainda oque o cara pediu.. Como assim mudar de tela/cameras?
Ele aperta a seta >
vai pra outro boneco e outra camera!
correto?