Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * *
- * [FS] Orginal TIME & DATE *
- * *
- * © 2011, Script by 4#Future *
- * *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- // ------------
- // - Includes -
- // ------------
- #include <a_samp>
- // -----------
- // - Defines -
- // -----------
- #define TIME_COLOR 0xFFFFFFFF // die Farbe ist beliebig wählbar (weiß)
- #define DATE_COLOR 0xBFBFBFFF // die Farbe ist beliebig wählbar (grau)
- new Text:ShowZeit, Text:ShowDatum;
- new stunde, minute;
- new tag, monat, jahr;
- forward UpdateZeit();
- forward UpdateDatum();
- // --------------
- // - Funktionen -
- // --------------
- public OnFilterScriptInit()
- {
- print(" ");
- print("[FILTERSCRIPT] Time & Date, by 4#Future");
- print(" ");
- return 1;
- }
- public OnGameModeInit()
- {
- // -- Textdraws --
- ShowZeit = TextDrawCreate(547.0, 13.0,"00:00"); // Zeit
- TextDrawLetterSize(ShowZeit, 0.62, 1.8);
- TextDrawFont(ShowZeit, 3);
- TextDrawColor(ShowDatum, TIME_COLOR);
- TextDrawSetOutline(ShowZeit, 1);
- TextDrawShowForAll(ShowZeit);
- UpdateZeit();
- SetTimer("UpdateZeit", 1000 * 60, 1);
- ShowDatum = TextDrawCreate(547.0, 31.0,"00.00.0000"); // Datum
- TextDrawLetterSize(ShowDatum, 0.33, 1.2);
- TextDrawFont(ShowDatum, 3);
- TextDrawColor(ShowDatum, DATE_COLOR);
- TextDrawSetOutline(ShowDatum, 1);
- TextDrawShowForAll(ShowDatum);
- UpdateDatum();
- SetTimer("UpdateDatum", 1000 * 60 * 60, 1);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid, ShowZeit);
- TextDrawShowForPlayer(playerid, ShowDatum);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- TextDrawHideForPlayer(playerid, ShowZeit);
- TextDrawHideForPlayer(playerid, ShowDatum);
- return 1;
- }
- //------------------------------------------------------------------------------
- public UpdateZeit()
- {
- new timestr[50];
- gettime(stunde, minute);
- format(timestr, 32, "%02d:%02d", stunde, minute);
- TextDrawSetString(ShowZeit, timestr);
- new x = 0;
- while(x != MAX_PLAYERS)
- {
- if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) { SetPlayerTime(x, stunde, minute); }
- x++;
- }
- }
- public UpdateDatum()
- {
- new datestr[50];
- getdate(jahr, monat, tag);
- format(datestr, 32, "%02d.%02d.%d", tag, monat, jahr);
- TextDrawSetString(ShowDatum, datestr);
- }
Advertisement
Add Comment
Please, Sign In to add comment