[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
#2

Alguem?
Reply
#3

Nгo faзa double-post, leia as regras.

pawn Код:
if(i_ServerHours == 18) SetWorldTime(23);
Reply
#4

e amanhecer de 5:30? e onde coloco
Reply
#5

Reply
#6

Puta que pariu, moleque! Serб que tu nгo sabe programar? Quer tudo na porra da sua mгo, vai se foder! Olha quantos tуpicos de pedido/ajuda tu jб criou nessa e na sua outra conta, idiota!

@desculpe as palavras de baixo calгo, mas esse moleque tб merecendo.
Reply
#7

Como jб ajudei..
pawn Код:
#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_ServerHours, i_ServerMinutes, i_ServerSeconds);
    getdate(i_ServerYears, i_ServerMonths, i_ServerDays);
    format(string, sizeof string, "%02d:%02d:%02d", i_ServerHours-4, i_ServerMinutes, i_ServerSeconds);
    TextDrawSetString(txtTimeDisp, string);


    if(i_ServerHours == 0)
    {
        format(string, sizeof string, "%02d:%02d:%02d", 20, i_ServerMinutes, i_ServerSeconds);
        TextDrawSetString(txtTimeDisp, string);

        format(string, sizeof string, "%02d/%02d/%04d", i_ServerDays , i_ServerMonths, i_ServerYears);
        TextDrawSetString(txtDateDisp, string);
        TextDrawShowForAll(txtTimeDisp);
    }
    if(i_ServerHours == 1)
    {
        format(string, sizeof string, "%02d:%02d:%02d", 21, i_ServerMinutes, i_ServerSeconds);
        TextDrawSetString(txtTimeDisp, string);
        TextDrawShowForAll(txtTimeDisp);
    }
    if(i_ServerHours == 2)
    {
        format(string, sizeof string, "%02d:%02d:%02d", 22, i_ServerMinutes, i_ServerSeconds);
        TextDrawSetString(txtTimeDisp, string);
        TextDrawShowForAll(txtTimeDisp);
    }
    if(i_ServerHours == 4)
    {
        format(string, sizeof string, "%02d:%02d:%02d", 23, i_ServerMinutes, i_ServerSeconds);
        TextDrawSetString(txtTimeDisp, string);
        TextDrawShowForAll(txtTimeDisp);
    }
    if(i_ServerHours == 18 && i_ServerSeconds == 0) SetWorldTime(0);
    if(i_ServerHours == 5 && i_ServerMinutes == 30 && i_ServerSeconds == 0) SetWorldTime(10);
    format(string, sizeof string, "%02d/%02d/%04d", i_ServerDays, i_ServerMonths, i_ServerYears);
    TextDrawSetString(txtDateDisp, string);
    return 1;
}

public OnFilterScriptInit()
{
    txtTimeDisp = TextDrawCreate(632.0,25.0,"--:--:--");
    TextDrawUseBox(txtTimeDisp, 0);
    TextDrawFont(txtTimeDisp, 3);
    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(txtDateDisp, 0);
    TextDrawFont(txtDateDisp, 3);
    TextDrawSetShadow(txtDateDisp,0);
    TextDrawSetOutline(txtDateDisp,2);
    TextDrawBackgroundColor(txtDateDisp,0x000000FF);
    TextDrawColor(txtDateDisp,0xFFFFFFFF);
    TextDrawAlignment(txtDateDisp,3);
    TextDrawLetterSize(txtDateDisp,0.5,1.5);

    ProcessGameTime();
    SetTimer("ProcessGameTime", 1000, 1);
    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(playerid, killerid, reason)
{
    TextDrawHideForPlayer(playerid,txtTimeDisp);
    TextDrawHideForPlayer(playerid,txtDateDisp);
    return 1;
}
Acredito que 10 jб seja o amanhecer.
Reply
#8

Bonito suas Palavras
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)