[Ajuda]Timer.
#1

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?
Reply
#2

Outra tela ? como assim ?
Reply
#3

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;
}
Reply
#4

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..
Reply
#5

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

}
Reply
#6

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?
Reply
#7

Requestclass + settimer.
Reply
#8

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;
}
Reply
#9

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

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?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)