Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===========================================================================================
- // Creditos
- // Retirado do playhappy, editado por zwoorelook
- //===========================================================================================
- //===========================================================================================
- // *TEXTDRAW
- //===========================================================================================
- new Text:Reloginho1;
- new Text:Reloginho2;
- new Text:Reloginho3;
- //===========================================================================================
- forward Fixhour(hora);
- forward Reloginho();
- new shifthour;
- new hour;
- new minute;
- new second;
- new ghour = 0;
- new timeshift = 0;
- stock SetHora()
- {
- gettime(hour, minute, second);
- if(hour == 0 && minute >= 0 && minute <= 59) { SetWorldTime(0); }
- if(hour == 1 && minute >= 0 && minute <= 59) { SetWorldTime(1); }
- if(hour == 2 && minute >= 0 && minute <= 59) { SetWorldTime(2); }
- if(hour == 3 && minute >= 0 && minute <= 59) { SetWorldTime(3); }
- if(hour == 4 && minute >= 0 && minute <= 59) { SetWorldTime(4); }
- if(hour == 5 && minute >= 0 && minute <= 39) { SetWorldTime(5); }
- if(hour == 5 && minute >= 40 && minute <= 49) { SetWorldTime(23); }
- if(hour == 5 && minute >= 50 && minute <= 59) { SetWorldTime(22); }
- if(hour == 6 && minute >= 0 && minute <= 9) { SetWorldTime(21); }
- if(hour == 6 && minute >= 30 && minute <= 59) { SetWorldTime(7); }
- if(hour == 7 && minute >= 0 && minute <= 59) { SetWorldTime(7); }
- if(hour == 8 && minute >= 0 && minute <= 59) { SetWorldTime(8); }
- if(hour == 9 && minute >= 0 && minute <= 59) { SetWorldTime(9); }
- if(hour == 10 && minute >= 0 && minute <= 59) { SetWorldTime(10); }
- if(hour == 11 && minute >= 0 && minute <= 59) { SetWorldTime(11); }
- if(hour == 12 && minute >= 0 && minute <= 59) { SetWorldTime(12); }
- if(hour == 13 && minute >= 0 && minute <= 59) { SetWorldTime(13); }
- if(hour == 14 && minute >= 0 && minute <= 59) { SetWorldTime(14); }
- if(hour == 15 && minute >= 0 && minute <= 59) { SetWorldTime(15); }
- if(hour == 16 && minute >= 0 && minute <= 59) { SetWorldTime(16); }
- if(hour == 17 && minute >= 0 && minute <= 59) { SetWorldTime(17); }
- if(hour == 17 && minute >= 35 && minute <= 39) { SetWorldTime(20); }
- if(hour == 17 && minute >= 40 && minute <= 49) { SetWorldTime(21); }
- if(hour == 17 && minute >= 55 && minute <= 59) { SetWorldTime(23); }
- if(hour == 18 && minute >= 0 && minute <= 29) { SetWorldTime(5); }
- if(hour == 19 && minute >= 0 && minute <= 59) { SetWorldTime(4); }
- if(hour == 20 && minute >= 0 && minute <= 59) { SetWorldTime(3); }
- if(hour == 21 && minute >= 0 && minute <= 59) { SetWorldTime(2); }
- if(hour == 22 && minute >= 0 && minute <= 59) { SetWorldTime(1); }
- if(hour == 23 && minute >= 0 && minute <= 59) { SetWorldTime(0); }
- }
- forward reloginho();
- forward SyncTime();
- public OnGameModeInit()
- {
- SetTimer("reloginho",1000,true);
- Reloginho1 = TextDrawCreate(553.00000,401.00000, "-");
- TextDrawFont(Reloginho1, 2);
- TextDrawColor(Reloginho1, 0xE5E5E5FF);
- TextDrawLetterSize(Reloginho1, 0.200000, 0.790000);
- TextDrawSetOutline(Reloginho1, 1);
- TextDrawSetProportional(Reloginho1, 1);
- TextDrawAlignment(Reloginho1, 2);
- TextDrawBackgroundColor(Reloginho1, 0x00000055);
- TextDrawSetShadow(Reloginho1, 1);
- Reloginho2 = TextDrawCreate(477.000000,377.000000, "-");
- //TextDrawBackgroundColor(Reloginho2, -65281);
- TextDrawBackgroundColor(Reloginho2, COLOR_LIGHTRED);
- TextDrawFont(Reloginho2, 1);
- TextDrawLetterSize(Reloginho2, 11.300043, 0.510000);
- TextDrawColor(Reloginho2, COLOR_GREEN);
- TextDrawSetOutline(Reloginho2, 0);
- TextDrawSetProportional(Reloginho2, 1);
- TextDrawSetShadow(Reloginho2, 1);
- Reloginho3 = TextDrawCreate(477.000000,409.000000, "-");
- TextDrawBackgroundColor(Reloginho3, COLOR_LIGHTRED);
- TextDrawFont(Reloginho3, 1);
- TextDrawLetterSize(Reloginho3, 11.300043, 0.510000);
- TextDrawColor(Reloginho3, COLOR_GREEN);
- TextDrawSetOutline(Reloginho3, 0);
- TextDrawSetProportional(Reloginho3, 1);
- TextDrawSetShadow(Reloginho3, 1);
- forum = TextDrawCreate(510.000000,382.000000, "~r~~h~Genesee~g~~h~~h~Play");
- TextDrawBackgroundColor(forum, 0x00000060);
- TextDrawFont(forum,1);
- TextDrawLetterSize(forum,0.500000, 1.700000);
- TextDrawColor(forum, -1);
- TextDrawSetOutline(forum,1);
- TextDrawSetProportional(forum,1);
- forum2 = TextDrawCreate(493.000000,415.000000, "www.GeneseeGamers.com");
- TextDrawBackgroundColor(forum2, 0x000030);
- TextDrawFont(forum2, 1);
- TextDrawLetterSize(forum2, 0.290000, 0.700000);
- TextDrawColor(forum2, COLOR_GREEN);
- TextDrawSetOutline(forum2, 1);
- TextDrawSetProportional(forum2, 1);
- TextDrawSetShadow(forum2, 1);
- return 1;
- }
- public OnGameModeExit()
- {
- TextDrawDestroy(Reloginho1);
- TextDrawDestroy(Reloginho2);
- TextDrawHideForAll(Reloginho1);
- TextDrawHideForAll(Reloginho2);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawShowForPlayer(playerid, Reloginho1);
- TextDrawShowForPlayer(playerid, Reloginho2);
- TextDrawShowForPlayer(playerid, Reloginho3);
- TextDrawShowForPlayer(playerid, forum);
- TextDrawShowForPlayer(playerid, forum2);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid, Reloginho1);
- TextDrawShowForPlayer(playerid, Reloginho2);
- TextDrawShowForPlayer(playerid, forum2);
- return 1;
- }
- public SyncTime()
- {
- new tmphour;
- new tmpminute;
- new tmpsecond;
- gettime(tmphour, tmpminute, tmpsecond);
- Fixhour(tmphour);
- tmphour = shifthour;
- if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
- {
- ghour = tmphour;
- SetHora();
- }
- }
- public reloginho()
- {
- SyncTime();
- new str[128];
- new
- ano,
- mes,
- dia,
- horas,
- minutos,
- segundos;
- getdate(ano, mes, dia);
- gettime(horas, minutos, segundos);
- format(str, sizeof(str), "~w~~h~~h~%d/%d/%d - %d:%d:%d", dia, mes, ano, horas, minutos, segundos);
- TextDrawSetString(Reloginho1, str);
- return true;
- }
- public Fixhour(hora)
- {
- hora = timeshift+hora;
- if (hora < 0)
- {
- hora = hora+24;
- }
- else if (hora > 23)
- {
- hora = hora-24;
- }
- shifthour = hora;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement