[Ajuda] Fazer Anoitecer as 6 horas da tarde
#1

Bom, alguem me diz como nesse FS...

PHP код:
#include <a_samp>
static i_ServerSeconds;
static 
i_ServerMinutes;
static 
i_ServerHours;
static 
i_ServerDays;
static 
i_ServerMonths;
static 
i_ServerYears;
new 
Text:txtTimeDisp;
new 
Text:txtDateDisp;
forward ProcessGameTime();
public 
ProcessGameTime()
{
    new 
string[128];
    
gettime(i_ServerHoursi_ServerMinutesi_ServerSeconds);
    
getdate(i_ServerYearsi_ServerMonthsi_ServerDays);
    
format(stringsizeof string"%02d:%02d:%02d"i_ServerHours-4i_ServerMinutesi_ServerSeconds);
    
TextDrawSetString(txtTimeDispstring);
    if(
i_ServerHours == 0)
    {
        
format(stringsizeof string"%02d:%02d:%02d"20i_ServerMinutesi_ServerSeconds);
        
TextDrawSetString(txtTimeDispstring);
        
        
format(stringsizeof string"%02d/%02d/%04d"i_ServerDays i_ServerMonthsi_ServerYears);
        
TextDrawSetString(txtDateDispstring);
        
TextDrawShowForAll(txtTimeDisp);
    }
    if(
i_ServerHours == 1)
    {
        
format(stringsizeof string"%02d:%02d:%02d"21i_ServerMinutesi_ServerSeconds);
        
TextDrawSetString(txtTimeDispstring);
        
TextDrawShowForAll(txtTimeDisp);
    }
    if(
i_ServerHours == 2)
    {
        
format(stringsizeof string"%02d:%02d:%02d"22i_ServerMinutesi_ServerSeconds);
        
TextDrawSetString(txtTimeDispstring);
        
TextDrawShowForAll(txtTimeDisp);
    }
    if(
i_ServerHours == 4)
    {
        
format(stringsizeof string"%02d:%02d:%02d"23i_ServerMinutesi_ServerSeconds);
        
TextDrawSetString(txtTimeDispstring);
        
TextDrawShowForAll(txtTimeDisp);
    }
    
format(stringsizeof string"%02d/%02d/%04d"i_ServerDaysi_ServerMonthsi_ServerYears);
    
TextDrawSetString(txtDateDispstring);
    }
public 
OnFilterScriptInit()
{
    
txtTimeDisp TextDrawCreate(632.0,25.0,"--:--:--");
    
TextDrawUseBox(txtTimeDisp0);
    
TextDrawFont(txtTimeDisp3);
    
TextDrawSetShadow(txtTimeDisp,0);
    
TextDrawSetOutline(txtTimeDisp,2);
    
TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
    
TextDrawColor(txtTimeDisp,0xFFFFFFFF);
    
TextDrawAlignment(txtTimeDisp,3);
    
TextDrawLetterSize(txtTimeDisp,0.5,1.5);
    
txtDateDisp TextDrawCreate(620.0,5.0,"00/00/0000");
    
TextDrawUseBox(txtDateDisp0);
    
TextDrawFont(txtDateDisp3);
    
TextDrawSetShadow(txtDateDisp,0);
    
TextDrawSetOutline(txtDateDisp,2);
    
TextDrawBackgroundColor(txtDateDisp,0x000000FF);
    
TextDrawColor(txtDateDisp,0xFFFFFFFF);
    
TextDrawAlignment(txtDateDisp,3);
    
TextDrawLetterSize(txtDateDisp,0.5,1.5);
    
ProcessGameTime();
    
SetTimer("ProcessGameTime"10001);
    return 
1;
}
public 
OnFilterScriptExit()
{
    
TextDrawHideForAll(txtTimeDisp);
    
TextDrawDestroy(txtTimeDisp);
    
TextDrawHideForAll(txtDateDisp);
    
TextDrawDestroy(txtDateDisp);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
TextDrawShowForPlayer(playerid,txtTimeDisp);
    
TextDrawShowForPlayer(playerid,txtDateDisp);
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
TextDrawHideForPlayer(playerid,txtTimeDisp);
    
TextDrawHideForPlayer(playerid,txtDateDisp);
    return 
1;

Reply


Messages In This Thread
Fazer Anoitecer as 6 horas da tarde - by Firelink - 19.02.2014, 20:30
Respuesta: Fazer Anoitecer as 6 horas da tarde - by Firelink - 19.02.2014, 20:40
Re: Fazer Anoitecer as 6 horas da tarde - by Myam - 19.02.2014, 20:43
Respuesta: Fazer Anoitecer as 6 horas da tarde - by Firelink - 19.02.2014, 20:46
Respuesta: Fazer Anoitecer as 6 horas da tarde - by Firelink - 19.02.2014, 21:22
Re: Fazer Anoitecer as 6 horas da tarde - by sofina - 19.02.2014, 21:23
Re: Fazer Anoitecer as 6 horas da tarde - by Myam - 19.02.2014, 21:27
Respuesta: Fazer Anoitecer as 6 horas da tarde - by Firelink - 19.02.2014, 21:27

Forum Jump:


Users browsing this thread: 1 Guest(s)