clock problem
#1

I tried this
Код:
forward Clock();
public Clock()
{
	new years, months, days, hours, minutes, seconds, data[128], clock[128];
	getdate(years, months, days);
 	gettime(hours, minutes, seconds);
	format(data, 128, "%i/%i/%i", days, minutes, years);
	format(clock, 128, "%i:%i:%i", hours, minutes, seconds);
	TextDrawSetString(Date, data);
	TextDrawSetString(Hour, data);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		   	TextDrawShowForPlayer(i,Date);
	 		TextDrawShowForPlayer(i,Hour);
	 	}
	}
	return 1;
}
in OnGameModeInt
Код:
	//Data
	Date = TextDrawCreate(502, 110, "Ora");
	TextDrawFont(Date , 3);
	TextDrawTextSize(Date, 0.5, 1);
	TextDrawColor(Date , 0xFFFFFFFF);
	TextDrawSetOutline(Date , 1);
	TextDrawSetProportional(Date , 1);
	TextDrawSetShadow(Date , 1);
	//Ora
	Hour = TextDrawCreate(549, 29, "Ora");
	TextDrawFont(Hour , 3);
	TextDrawTextSize(Hour, 0.5, 1);
	TextDrawColor(Hour , 0xFFFFFFFF);
	TextDrawSetOutline(Hour , 1);
	TextDrawSetProportional(Hour , 1);
	TextDrawSetShadow(Hour , 1);

	SetTimer("Clock", 100, true);
Why it's not showing up? I have no errors/warning
Reply
#2

Try this

Код:
forward Clock();
public Clock()
{
	new years, months, days, hours, minutes, seconds, data[128], clock[128];
	getdate(years, months, days);
 	gettime(hours, minutes, seconds);
	format(data, 128, "%i/%i/%i", days, minutes, years);
	TextDrawSetString(Date, data);
	format(clock, 128, "%i:%i:%i", hours, minutes, seconds);
	TextDrawSetString(Hour, clock);
	return 1;
}


//Data
	Date = TextDrawCreate(502, 110, "Ora");
	TextDrawFont(Date , 3);
	TextDrawTextSize(Date, 0.5, 1);
	TextDrawColor(Date , 0xFFFFFFFF);
	TextDrawSetOutline(Date , 1);
	TextDrawSetProportional(Date , 1);
	TextDrawSetShadow(Date , 1);
	//Ora
	Hour = TextDrawCreate(549, 29, "Ora");
	TextDrawFont(Hour , 3);
	TextDrawTextSize(Hour, 0.5, 1);
	TextDrawColor(Hour , 0xFFFFFFFF);
	TextDrawSetOutline(Hour , 1);
	TextDrawSetProportional(Hour , 1);
	TextDrawSetShadow(Hour , 1);

	SetTimer("Clock", 100, true);
Reply
#3

Put this code
PHP код:
new yearsmonthsdayshoursminutessecondsdata[128], clock[128];
    
getdate(yearsmonthsdays);
     
gettime(hoursminutesseconds);
    
format(data128"%i/%i/%i"daysminutesyears);
    
format(clock128"%i:%i:%i"hoursminutesseconds);
    
TextDrawSetString(Datedata);
    
TextDrawSetString(Hourdata);
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
               
TextDrawShowForPlayer(i,Date);
             
TextDrawShowForPlayer(i,Hour);
         }
    }
    return 
1
in OnPlayerConnect or OnPlayerSpawn I'm not very experienced in textdraw but if I were you, I would have tried this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)