SA-MP Forums Archive
Reloj AYUDA - 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: Reloj AYUDA (/showthread.php?tid=614490)



Reloj AYUDA - Zodiaco - 08.08.2016

Hola amigos del samp, saque un pequeсo reloj o sistema de conteo en reversa de un FS y funciona bien, pero me surgiу una duda.. Como puedo hacer para que comience de 3 min el conteo y vaya bajando, porque este comienza de 60 segundos..

una imagen



Les dejo mis dos funciones que manejan el reloj..

PHP код:
COMMAND:reloj(playeridparams[]){
StopAudioStreamForPlayer(playerid);
for(new 
msg=0msg<32msg++) {SendClientMessage(playerid,-1," ");}
PlayerTextDrawShow(playerid,InfoLabyrinth[playerid][countertext]);
InfoLabyrinth[playerid][labyrinthtimer]=gettime()+60;
KillTimer(InfoLabyrinth[playerid][countertextTimer]);
InfoLabyrinth[playerid][countertextTimer]=SetTimerEx("updatecounter",1000,true,"d",playerid);
SendClientMessage(playerid,COLOR_GREEN,"INFO: REloj ON.");
return 
true;
}
forward updatecounter(playerid);
public 
updatecounter(playerid){
new 
HourMinuteSeconddata[30];
if(
InfoLabyrinth[playerid][labyrinthtimer]>gettime()){
format(data,sizeof(data), "~w~00:%02d"InfoLabyrinth[playerid][labyrinthtimer]-gettime());
PlayerTextDrawSetString(playerid,InfoLabyrinth[playerid][countertext], data);
PlayerPlaySound(playerid10570.00.00.0);
}
else{
gettime(HourMinuteSecond);
for(new 
msg=0msg<32msg++) {SendClientMessage(playerid,-1," ");}
PlayerTextDrawHide(playerid,InfoLabyrinth[playerid][countertext]);
KillTimer(InfoLabyrinth[playerid][countertextTimer]);
SendClientMessage(playerid,COLOR_RED,"INFO: Reloj OFF.");
GameTextForPlayer(playerid"~n~~n~~n~~n~~w~YOU ~r~LOSER!!."40003);
}
return 
true;

muchas gracias


Respuesta: Reloj AYUDA - Whyd - 09.08.2016

Fijate en la lнnea
pawn Код:
InfoLabyrinth[playerid][labyrinthtimer]=gettime()+60;
Cambialo a InfoLabyrinth[playerid][labyrinthtimer]=gettime()+180; y prueba


Re: Respuesta: Reloj AYUDA - Zodiaco - 09.08.2016

Quote:
Originally Posted by hydewhyd
Посмотреть сообщение
Fijate en la lнnea
pawn Код:
InfoLabyrinth[playerid][labyrinthtimer]=gettime()+60;
Cambialo a InfoLabyrinth[playerid][labyrinthtimer]=gettime()+180; y prueba
Pero va empezar de 180 Segundos y no de 3:00 min yo quisiera que vaya bajando en 3:45 - 3:10 , 2:30 asi sucesivamente.


Re: Reloj AYUDA - jhgr16 - 09.08.2016

Quote:

InfoLabyrinth[playerid][labyrinthtimer]=gettime()+180;

format(data,sizeof(data), "~w~%02d:%02d", (InfoLabyrinth[playerid][labyrinthtimer]-gettime())/60, (InfoLabyrinth[playerid][labyrinthtimer]-gettime())%60);
En teorнa ya deberнa de funcionar con 180 segundos y mostrarse como lo buscas.


Re: Reloj AYUDA - Zodiaco - 10.08.2016

Quote:
Originally Posted by jhgr16
Посмотреть сообщение
En teorнa ya deberнa de funcionar con 180 segundos y mostrarse como lo buscas.
gracias funciona bien