Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------------------------------------
- //Watch System v1
- //Created By : ~WhiteAngels
- //------------------------------------------
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- new Text:Watch0;
- new Text:Watch1;
- new Text:Watch2;
- new Text:Watch3;
- public OnFilterScriptInit()
- {
- Watch0 = TextDrawCreate(447.000000, 281.000000, "Time : ");
- TextDrawBackgroundColor(Watch0, 255);
- TextDrawFont(Watch0, 1);
- TextDrawLetterSize(Watch0, 0.439999, 1.399999);
- TextDrawColor(Watch0, 16711935);
- TextDrawSetOutline(Watch0, 1);
- TextDrawSetProportional(Watch0, 1);
- TextDrawUseBox(Watch0, 1);
- TextDrawBoxColor(Watch0, 135);
- TextDrawTextSize(Watch0, 610.000000, 50.000000);
- Watch1 = TextDrawCreate(447.000000, 300.000000, "Date : ");
- TextDrawBackgroundColor(Watch1, 255);
- TextDrawFont(Watch1, 1);
- TextDrawLetterSize(Watch1, 0.439999, 1.399999);
- TextDrawColor(Watch1, 16711935);
- TextDrawSetOutline(Watch1, 1);
- TextDrawSetProportional(Watch1, 1);
- TextDrawUseBox(Watch1, 1);
- TextDrawBoxColor(Watch1, 135);
- TextDrawTextSize(Watch1, 610.000000, 50.000000);
- Watch2 = TextDrawCreate(512.000000, 282.000000, "12:00");
- TextDrawBackgroundColor(Watch2, 255);
- TextDrawFont(Watch2, 3);
- TextDrawLetterSize(Watch2, 0.410000, 1.300000);
- TextDrawColor(Watch2, -1);
- TextDrawSetOutline(Watch2, 1);
- TextDrawSetProportional(Watch2, 1);
- Watch3 = TextDrawCreate(512.000000, 300.000000, "31/12/2014");
- TextDrawBackgroundColor(Watch3, 255);
- TextDrawFont(Watch3, 3);
- TextDrawLetterSize(Watch3, 0.410000, 1.300000);
- TextDrawColor(Watch3, -1);
- TextDrawSetOutline(Watch3, 1);
- TextDrawSetProportional(Watch3, 1);
- print("\n----------------------------------------");
- print("Watch System v1.0 - Created By WhiteAngels");
- print("----------------------------------------\n");
- SetTimer("WatchSettime",1000,true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:watch(playerid,params[]) {
- TextDrawShowForPlayer(playerid, Watch0), TextDrawShowForPlayer(playerid, Watch1), TextDrawShowForPlayer(playerid, Watch2), TextDrawShowForPlayer(playerid, Watch3);
- SetTimerEx("CloseWatch", 10000, 0, "i", playerid);
- return 1;
- }
- //Watch System
- forward WatchSettime();
- public WatchSettime()
- {
- new string[256];
- new Year,Month,Day; getdate(Year, Month, Day);
- new Hour,Min,Sec; gettime(Hour,Min,Sec);
- format(string, sizeof string, "%d/%s%d/%s%d", Day, ((Month < 10) ? ("0") : ("")), Month, (Year < 10) ? ("0") : (""), Year);
- TextDrawSetString(Watch3, string);
- format(string, sizeof string, "%s%d:%s%d:%s%d", (Hour < 10) ? ("0") : (""), Hour, (Min < 10) ? ("0") : (""), Min, (Sec < 10) ? ("0") : (""), Sec);
- TextDrawSetString(Watch2, string);
- }
- forward CloseWatch(playerid);
- public CloseWatch(playerid)
- {
- TextDrawHideForPlayer(playerid, Watch0), TextDrawHideForPlayer(playerid, Watch1), TextDrawHideForPlayer(playerid, Watch2), TextDrawHideForPlayer(playerid, Watch3);
- return 1;
- }
Add Comment
Please, Sign In to add comment