SA-MP Forums Archive
[Pedido] Relogio tipo do gta off line - 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: [Pedido] Relogio tipo do gta off line (/showthread.php?tid=368805)



Relogio tipo do gta off line - [toːkʲoː]_Shinjuku_.] - 14.08.2012

Eae Manolos Tranquilidade.
Precisando de uma ajuda ai

sabe aquele relуgio do gta offline que hб cada um 1 minuto ele troca de hora automбtico quero colocar um desse no meu servidor porque й muito ruim ter que fica trocando hб hora toda hora por comando ai desse jeito hб hora jб troca sozinho alguйm ai poderia ajudar ?


Re: Relogio tipo do gta off line - Abravanel - 14.08.2012

gl_realtime
Й um filterscript que vem junto а pasta cliente.


Re: Relogio tipo do gta off line - Kuddy - 14.08.2012

Simples, usa a FS gl_realtime

pawn Код:
//
// Keeps the in game time synced to the server's time and
// draws the current time on the player's hud using a textdraw/
// (1 minute = 1 minute real world time)
//
//  Kye 2009

#include <a_samp>
#pragma tabsize 0

//--------------------------------------------------

new Text:txtTimeDisp;
new hour, minute;
new timestr[32];

forward UpdateTime();

//--------------------------------------------------


public UpdateTime()
{
    gettime(hour, minute);
    format(timestr,32,"%02d:%02d",hour,minute);
    TextDrawSetString(txtTimeDisp,timestr);
   
    SetWorldTime(hour);
   
    new x=0;
    while(x!=MAX_PLAYERS) {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
            SetPlayerTime(x,hour,minute);
         }
         x++;
    }
}

//--------------------------------------------------

public OnGameModeInit()
{
    // Init our text display
    txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00");
    TextDrawUseBox(txtTimeDisp, 0);
    TextDrawFont(txtTimeDisp, 3);
    TextDrawSetShadow(txtTimeDisp,0); // no shadow
    TextDrawSetOutline(txtTimeDisp,2); // thickness 1
    TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
    TextDrawColor(txtTimeDisp,0xFFFFFFFF);
    TextDrawAlignment(txtTimeDisp,3);
    TextDrawLetterSize(txtTimeDisp,0.5,1.5);
   
    UpdateTime();
    SetTimer("UpdateTime",1000 * 60,1);

    return 1;
}

//--------------------------------------------------

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid,txtTimeDisp);
   
    gettime(hour, minute);
    SetPlayerTime(playerid,hour,minute);
   
    return 1;
}

//--------------------------------------------------

public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawHideForPlayer(playerid,txtTimeDisp);
    return 1;
}

//--------------------------------------------------

public OnPlayerConnect(playerid)
{
    gettime(hour, minute);
    SetPlayerTime(playerid,hour,minute);
    return 1;
}

//--------------------------------------------------
@edit
Eu e o AFerreira postamos ao mesmo tempo u_U


Re: Relogio tipo do gta off line - EduardoRFS - 14.08.2012

nгo ele nгo quer tempo real e sim tipo 1min=1hora vcs se lembram do gta off й assim.


Re: Relogio tipo do gta off line - [BR]Michael - 14.08.2012

Й horбrio ingame? Se for ingame й sу coloar no OnPlayerSpawn:

"TogglePlayerClock(playerid, true);"


Re: Relogio tipo do gta off line - [toːkʲoː]_Shinjuku_.] - 14.08.2012

й igual o eduado falo ali ok
vo tenta isso do michael.


Re: Relogio tipo do gta off line - [toːkʲoː]_Shinjuku_.] - 14.08.2012

eai funciono
michael do jeito que eu queria
+reep pa-tu manolo
~~~~~~~~~~~~~~~~
valeu povo