Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Text:Reloginho1, Text:Reloginho2, Text:Reloginho3;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" [FS] Hora Real");
- print(" www.sampextremeoficial.blogspot.com");
- print("--------------------------------------\n");
- SetTimerEx("HoraReal",1000,false,"i",playerid);
- //HORA
- Reloginho2 = TextDrawCreate(551.000000, 28.000000, "~w~~h~00:00:00");
- TextDrawBackgroundColor(Reloginho2, 50);
- TextDrawFont(Reloginho2, 1);
- TextDrawLetterSize(Reloginho2, 0.360000, 1.900000);
- TextDrawColor(Reloginho2, -1);
- TextDrawSetOutline(Reloginho2, 1);
- TextDrawSetProportional(Reloginho2, 1);
- TextDrawSetShadow(Reloginho2, 1);
- TextDrawSetSelectable(Reloginho2, 0);
- //Data
- Reloginho1 = TextDrawCreate(543.000000, 1.000000, "~w~~h~00/00/0000");
- TextDrawBackgroundColor(Reloginho1, 50);
- TextDrawFont(Reloginho1, 1);
- TextDrawLetterSize(Reloginho1, 0.360000, 1.900000);
- TextDrawColor(Reloginho1, -1);
- TextDrawSetOutline(Reloginho1, 1);
- TextDrawSetProportional(Reloginho1, 1);
- TextDrawSetShadow(Reloginho1, 1);
- TextDrawSetSelectable(Reloginho1, 0);
- //Dia Da Semana
- Reloginho3 = TextDrawCreate(563.000000, 19.000000, "~b~~h~~h~sexta-feira");
- TextDrawBackgroundColor(Reloginho3, 0);
- TextDrawFont(Reloginho3, 1);
- TextDrawLetterSize(Reloginho3, 0.200000, 1.200000);
- TextDrawColor(Reloginho3, -1);
- TextDrawSetOutline(Reloginho3, 1);
- TextDrawSetProportional(Reloginho3, 1);
- TextDrawSetShadow(Reloginho3, 1);
- TextDrawSetSelectable(Reloginho3, 0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(HoraReal);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawShowForPlayer(playerid, Reloginho1);
- TextDrawShowForPlayer(playerid, Reloginho2);
- TextDrawShowForPlayer(playerid, Reloginho3);
- return 1;
- }
- static stock VerSemana(const PT_Dia, const PT_Mes, const PT_Ano)
- {
- new PT_A = (14 - PT_Mes) / 12, PT_B = PT_Ano - PT_A, PT_C = (PT_Mes + (12 * PT_A)) - 2, PT_D = (((((PT_Dia + ((31 * PT_C) / 12)) + PT_B) + (PT_B / 4)) - (PT_B / 100)) + (PT_B / 400)), PT_E = PT_D % 7;
- static const PTSemana[7][14] = { "Domingo", "Segunda-Feira", "Terca-Feira", "Quarta-Feira", "Quinta-Feira", "Sexta-Feira", "Sabado" };
- return PTSemana[PT_E];
- }
- forward HoraReal();
- public HoraReal()
- {
- new str[100];
- new
- ano,
- mes,
- dia,
- horas,
- minutos,
- segundos;
- getdate(ano, mes, dia);
- gettime(horas, minutos, segundos);
- format( stringpayday, sizeof stringpayday, "~b~~h~~h~%s",VerSemana(dia,mes,ano));
- TextDrawSetString(Reloginho3, stringpayday);
- format( str, sizeof(str), "~w~%02d:%02d:%02d",horas, minutos, segundos);
- TextDrawSetString(Reloginho2, str);
- format( str, sizeof str, "~w~%02d/%02d/%d",dia, mes, ano);
- TextDrawSetString(Reloginho1, str);
- SetWorldTime(hora);
- TextDrawShowForPlayer(playerid, Reloginho1);
- TextDrawShowForPlayer(playerid, Reloginho2);
- TextDrawShowForPlayer(playerid, Reloginho3);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement