[Ajuda]Timer.
#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


Messages In This Thread
[Ajuda]Timer. - by Pedro Pawno - 11.04.2012, 11:56
Re: [DUV]Timer. - by Rick_DR - 11.04.2012, 12:00
Re: [DUV]Timer. - by Macintosh - 11.04.2012, 12:01
Respuesta: Re: [DUV]Timer. - by Pedro Pawno - 11.04.2012, 12:07
Re: [DUV]Timer. - by Ricop522 - 11.04.2012, 12:16
Respuesta: Re: [DUV]Timer. - by Pedro Pawno - 11.04.2012, 12:45
Re: [Ajuda]Timer. - by Ricop522 - 11.04.2012, 13:21
Re: [Ajuda]Timer. - by zSuYaNw - 11.04.2012, 13:52
Re: [Ajuda]Timer. - by Felipe_Wesker - 11.04.2012, 17:26
Re: [Ajuda]Timer. - by dPlaYer_ - 11.04.2012, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)