[Ajuda] Problema No Relogio!?
#1

Eu coloquei um sistema de relogio com data e hora certa,ai pegou tudo serto so q quando eu entro a data ta 27/07/2013 e o relogio ta com a hora errada ,como posso corrigir esse erro ?
Reply
#2

Mande o cуdigo
Reply
#3

Quote:

/*
WWW.UNIDADESAMP.BLOGSPOT.COM.BR - DIVULGUE SEU SERVIDOR SA:MP

SISTEMA DE RELУGIO DESENVOLVIDO POR: KANUY
NГO RETIRE OS CRЙDITOS!!

CASO ENCONTRE ALGUM BUG CONTATAR PELO
SKYPE: kanuy.us




UU UU NN NN IIII DDDD AAA DDDD EEEEEEE
UU UU N N NN II D DD AA AA D DD EE
UU UU N N NN II D DD AA AA D DD EEEE
UU UU NN N N II D DD AA AA D DD EEEE
UU UU NN N N II D DD AA AAAAA AA D DD EE
UUUUU NN NNN IIII DDDD AA AA DDDD EEEEEEE

SSSSSSS AA MM MM PPPPPPPPP
SSSS SSSS AAAA MM MM PPP PPP
SSSS SS AAAAAA ::: MMM MMM PP PP
SSSSS AAAAAAAA ::: MMMMMMMMMMMM PP PPP
SSSSSSSS AAA AAA MMMMMMMMMMMM PPPPPPPPP
SSSSS AAAA AAAA ::: MM MM MM PP
SS SSSS AAAAAAAAAAAAAA ::: MM MM MM PP
SSSS SSSS AAAA AAAA MM MM PP
SSSSSSSS AAAAAA AAAAAA MM MM PP

WWW.UNIDADESAMP.BLOGSPOT.COM.BR
Visite nosso blog. Divulgue seu servidor SA:MP




*/
#include <a_samp>

//------------------
new Text:Relogio;
new Textata;
forward Hora();
//------------------

public OnGameModeInit()
{
print("-----------------------------");
print("Sistema de Relogio Carregado");
print("Desenvolvido por: Kanuy");
print("Baixado de:");
print("UNIDADESAMP.BLOGSPOT.COM.BR");
print("-----------------------------");

SetTimer("Hora", 1000, true);
Relogio = TextDrawCreate(470.000000,4.000000,"");
Data = TextDrawCreate(550.000000,23.000000,"");
TextDrawAlignment(Relogio,0);
TextDrawAlignment(Data,0);
TextDrawBackgroundColor(Relogio,0x000000AA);
TextDrawBackgroundColor(Data,0x000000AA);
TextDrawFont(Relogio,3);
TextDrawLetterSize(Relogio,0.500000,2.000000);
TextDrawFont(Data,3);
TextDrawLetterSize(Data,0.399999,2.000000);
TextDrawColor(Relogio,0xffffffff);
TextDrawColor(Data,0xffffffff);
TextDrawSetProportional(Relogio,1);
TextDrawSetProportional(Data,1);
TextDrawSetShadow(Relogio,1);
TextDrawSetShadow(Data,1);
TextDrawSetOutline(Relogio,1);
TextDrawSetOutline(Data,1);
TextDrawShowForAll(Relogio);
TextDrawShowForAll(Data);
return 1;
}
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid, true);
TextDrawHideForAll(Relogio);
TextDrawShowForPlayer(playerid, Relogio);
TextDrawHideForAll(Data);
TextDrawShowForPlayer(playerid, Data);
return 1;
}
public Hora()
{
new mtext[6];
new year, month,day;
getdate(year, month, day);
if(month == 1) { mtext = "01"; }
else if(month == 2) { mtext = "02"; }
else if(month == 3) { mtext = "03"; }
else if(month == 4) { mtext = "04"; }
else if(month == 5) { mtext = "05"; }
else if(month == 6) { mtext = "06"; }
else if(month == 7) { mtext = "07"; }
else if(month == { mtext = "08"; }
else if(month == 9) { mtext = "09"; }
else if(month == 10) { mtext = "10"; }
else if(month == 11) { mtext = "11"; }
else if(month == 12) { mtext = "12"; }

new string[28], hora, minuto, segundo,stext[6];
gettime(hora, minuto, segundo);
if(segundo == 0) {stext = "00";}
else if(segundo == 1) { stext = "01"; }
else if(segundo == 2) { stext = "02"; }
else if(segundo == 3) { stext = "03"; }
else if(segundo == 4) { stext = "04"; }
else if(segundo == 5) { stext = "05"; }
else if(segundo == 6) { stext = "06"; }
else if(segundo == 7) { stext = "07"; }
else if(segundo == { stext = "08"; }
else if(segundo == 9) { stext = "09"; }
else if(segundo == 10) { stext = "11"; }
else if(segundo == 11) { stext = "11"; }
else if(segundo == 12) { stext = "12"; }
else if(segundo == 13) { stext = "13"; }
else if(segundo == 14) { stext = "14"; }
else if(segundo == 15) { stext = "15"; }
else if(segundo == 16) { stext = "16"; }
else if(segundo == 17) { stext = "16"; }
else if(segundo == 1 { stext = "18"; }
else if(segundo == 19) { stext = "19"; }
else if(segundo == 20) { stext = "20"; }
else if(segundo == 21) { stext = "21"; }
else if(segundo == 22) { stext = "22"; }
else if(segundo == 23) { stext = "23"; }
else if(segundo == 24) { stext = "24"; }
else if(segundo == 25) { stext = "25"; }
else if(segundo == 26) { stext = "26"; }
else if(segundo == 27) { stext = "27"; }
else if(segundo == 2 { stext = "28"; }
else if(segundo == 29) { stext = "29"; }
else if(segundo == 30) { stext = "30"; }
else if(segundo == 31) { stext = "31"; }
else if(segundo == 32) { stext = "32"; }
else if(segundo == 33) { stext = "33"; }
else if(segundo == 34) { stext = "34"; }
else if(segundo == 35) { stext = "35"; }
else if(segundo == 36) { stext = "36"; }
else if(segundo == 37) { stext = "37"; }
else if(segundo == 3 { stext = "38"; }
else if(segundo == 39) { stext = "39"; }
else if(segundo == 40) { stext = "40"; }
else if(segundo == 41) { stext = "41"; }
else if(segundo == 42) { stext = "42"; }
else if(segundo == 43) { stext = "43"; }
else if(segundo == 44) { stext = "44"; }
else if(segundo == 45) { stext = "45"; }
else if(segundo == 46) { stext = "46"; }
else if(segundo == 47) { stext = "47"; }
else if(segundo == 4 { stext = "48"; }
else if(segundo == 49) { stext = "49"; }
else if(segundo == 50) { stext = "50"; }
else if(segundo == 51) { stext = "51"; }
else if(segundo == 52) { stext = "52"; }
else if(segundo == 53) { stext = "53"; }
else if(segundo == 54) { stext = "54"; }
else if(segundo == 55) { stext = "55"; }
else if(segundo == 56) { stext = "56"; }
else if(segundo == 57) { stext = "57"; }
else if(segundo == 5 { stext = "58"; }
else if(segundo == 59) { stext = "59"; }
else if(segundo == 60) { stext = "60"; }
format(string, sizeof string, " %d/%s/2014", day, mtext);
TextDrawSetString(Relogio, string);
format(string, sizeof string, "%d:%d:%s",hora,minuto,stext);
TextDrawSetString(Data, string);
}

a data eu ja consertei mais o relogio nn
Reply
#4

Tenta isso jovem..

pawn Код:
#include <a_samp>

new Text:Relogio;
new Text:Data;


public OnGameModeInit()
{
    print("-----------------------------");
    print("Sistema de Relogio Carregado");
    print("Desenvolvido por: Kanuy");
    print("-----------------------------");

    SetTimer("Hora", 1000, true);
   
   
    Relogio = TextDrawCreate(470.000000,4.000000,"");
    Data = TextDrawCreate(550.000000,23.000000,"");
    TextDrawAlignment(Relogio,0);
    TextDrawAlignment(Data,0);
    TextDrawBackgroundColor(Relogio,0x000000AA);
    TextDrawBackgroundColor(Data,0x000000AA);
    TextDrawFont(Relogio,3);
    TextDrawLetterSize(Relogio,0.500000,2.000000);
    TextDrawFont(Data,3);
    TextDrawLetterSize(Data,0.399999,2.000000);
    TextDrawColor(Relogio,0xffffffff);
    TextDrawColor(Data,0xffffffff);
    TextDrawSetProportional(Relogio,1);
    TextDrawSetProportional(Data,1);
    TextDrawSetShadow(Relogio,1);
    TextDrawSetShadow(Data,1);
    TextDrawSetOutline(Relogio,1);
    TextDrawSetOutline(Data,1);
    TextDrawShowForAll(Relogio);
    TextDrawShowForAll(Data);
    return 1;
}


public OnPlayerSpawn(playerid)
{
    TogglePlayerControllable(playerid, true);
    TextDrawHideForAll(Relogio);
    TextDrawShowForPlayer(playerid, Relogio);
    TextDrawHideForAll(Data);
    TextDrawShowForPlayer(playerid, Data);
    return 1;
}


forward Hora();public Hora()
{
    static _ist[20], d, m, a; getdate(a, m, d);
    format(_ist, sizeof _ist, " %i/%02d/2014", d, m);
    TextDrawSetString(Relogio, _ist);

    gettime(a, m, d);
    format(_ist, sizeof _ist, "%02d:%02d:%02d",a,m,d);
    TextDrawSetString(Data, _ist);
   
    TextDrawShowForAll(Data);
    TextDrawShowForAll(Relogio);
}
Reply
#5

pegou nn
Reply
#6

O Relogio do seu PC estб correto? Porque a funзгo gettime e getdate pega as informaзхes da maquina onde o script estб hospedado.
Reply
#7

copilou certinho mais nn apareceu o relogio
Reply
#8

o relogio do meu pc ta certo
Reply
#9

aki o relogio q o cara passou ,pegou,ele ta con a data certa e ta com 7 horas adiantados ,mais os minutos e segundos estao certos
Reply
#10

a um tempгo atraz, abri meu servidor, ai estava com o mesmo problema que o seu, criei um ticket e pedi
para eles concerta a hora ( pessoal do host )

se vocк estiver usando Host, abre um ticket pedindo para eles concerta a hora ... caso nгo esteja usando, continua mechendo em seu GameMode ai quando for abrir o seu servidor e a hora estiver errada ainda, pede eles para concerta
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)