SA-MP Forums Archive
Ayuda HORA en textdraw - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Ayuda HORA en textdraw (/showthread.php?tid=145484)



Ayuda HORA en textdraw - not - 02.05.2010

Mi code de hora:
Код:
     new hour,minute,second;
	new string[256];
	gettime(hour,minute,second);
	if (minute <= 9){format(string,25,"%d:0%d",hour,minute);}
	else {format(string,25,"%d:%d",hour,minute);}
	TextDrawSetString(Clock,string);
quiero que la hora del textdraw sea 2 horas menos que la del servidor, pense en aсadir esto pero no funciono:


new hour,minute,second;
new string[256];
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%-2d:0%d",hour,minute);}
else {format(string,25,"%-2d:%d",hour,minute);}
TextDrawSetString(Clock,string)


Algun consejo



Re: Ayuda HORA en textdraw - Master[Pro] - 02.05.2010

Si usas el Gm de Lvdm Apreta la tecla Crtl+F y Buscas la palabra
Код:
TogglePlayerClock(playerid,1);
Tal cual la puse Nose lo que podria ser si no es eso


Re: Ayuda HORA en textdraw - not - 02.05.2010

eso sirve para cojer la ora de cada jugador yo qiero una hora para todos osea la del servidor pero con 2menos de diferencia


Re: Ayuda HORA en textdraw - not - 02.05.2010

Nadie lo sabe?


Re: Ayuda HORA en textdraw - xenowort - 02.05.2010

Podrias meter la hora en una variable en un timer para que se actualize, y ahi en la variable le restas 2000 y te deberia quedar bien.


Re: Ayuda HORA en textdraw - not - 02.05.2010

alguna base porfis ? llevo bastante sin scrptear :P


Re: Ayuda HORA en textdraw - Cesar_Biker - 02.05.2010

Prueba en vez de:
Quote:

new hour,minute,second;
new string[256];
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%-2d:0%d",hour,minute);}
else {format(string,25,"%-2d:%d",hour,minute);}
TextDrawSetString(Clock,string)

A esto:
Quote:

new hour,minute,second;
new string[256];
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%d:0%d",hour-2,minute);}
else {format(string,25,"%d:%d",hour-2,minute);}
TextDrawSetString(Clock,string)




Re: Ayuda HORA en textdraw - Miguel - 02.05.2010

pawn Код:
new
  hours,
  minutes,
  seconds,
  string[6];

gettime(hours, minutes, seconds);
hours = hours - 2;
if(hours < 0) hours = hours + 24;
format(stirng, sizeof(string), "%02d:%02d", hours, minutes);
TextDrawSetString(Clock, string);



Re: Ayuda HORA en textdraw - not - 02.05.2010

Quote:
Originally Posted by Cesar_Biker
Prueba en vez de:
Quote:

new hour,minute,second;
new string[256];
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%-2d:0%d",hour,minute);}
else {format(string,25,"%-2d:%d",hour,minute);}
TextDrawSetString(Clock,string)

A esto:
Quote:

new hour,minute,second;
new string[256];
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%d:0%d",hour-2,minute);}
else {format(string,25,"%d:%d",hour-2,minute);}
TextDrawSetString(Clock,string)

MUCHAS GRACIAS PERO NO ME SIRVIO!! funciona en mi pc pero cuando lo subo nada me pone -1 de ora :S

PD: Gracias ati tambien SAWC intentare con tu manera
PD2: Como poneis el pawn code? [pwn][/pwn] ?? ami no me sirve


Re: Ayuda HORA en textdraw - Carlos_Martinez - 02.05.2010

Quote:
Originally Posted by not
Quote:
Originally Posted by Cesar_Biker
Prueba en vez de:
Quote:

new hour,minute,second;
new string[256];
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%-2d:0%d",hour,minute);}
else {format(string,25,"%-2d:%d",hour,minute);}
TextDrawSetString(Clock,string)

A esto:
Quote:

new hour,minute,second;
new string[256];
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%d:0%d",hour-2,minute);}
else {format(string,25,"%d:%d",hour-2,minute);}
TextDrawSetString(Clock,string)

MUCHAS GRACIAS PERO NO ME SIRVIO!! funciona en mi pc pero cuando lo subo nada me pone -1 de ora :S

PD: Gracias ati tambien SAWC intentare con tu manera
PD2: Como poneis el pawn code? [pwn][/pwn] ?? ami no me sirve
es [pawn] Codigo aca [ /pawn] jeje asi es (tiene qe ir junto)

PD: Disculpa no se de tu problema xD