Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // FS by Yagel/y2g3L
- #include <a_samp>
- new Text:Clock[2];
- forward ClockUpdate(playerid);
- public OnFilterScriptInit()
- {
- SetTimer("ClockUpdate", 1000, true);
- Clock[0] = TextDrawCreate(547.000000, 4.000000, " ");
- TextDrawFont(Clock[0], 3);
- TextDrawLetterSize(Clock[0], 0.509999, 2.000000);
- TextDrawSetShadow(Clock[0], 1);
- TextDrawColor(Clock[0], -1);
- Clock[1] = TextDrawCreate(554.000000, 21.000000, " ");
- TextDrawFont(Clock[1], 3);
- TextDrawLetterSize(Clock[1], 0.370000, 1.400000);
- TextDrawSetShadow(Clock[1], 1);
- TextDrawColor(Clock[1], 65535);
- return 1;
- }
- public OnFilterScriptExit() return 1;
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid, Clock[0]), TextDrawShowForPlayer(playerid, Clock[1]);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawHideForPlayer(playerid, Clock[0]), TextDrawHideForPlayer(playerid, Clock[1]);
- return 1;
- }
- public ClockUpdate(playerid)
- {
- new str[256], date[3], time[3];
- getdate(date[0], date[1], date[2]), gettime(time[0], time[1], time[2]);
- format(str, sizeof(str), "%02d/%02d/%d", date[2], date[1], date[0]), TextDrawSetString(Clock[1], str);
- format(str, sizeof(str), "%02d:%02d:%02d", time[0], time[1], time[2]), TextDrawSetString(Clock[0], str);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement