Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Text:TDEditor_TD[2];
- forward UpdateClock(playerid);
- public OnFilterScriptInit()
- {
- SetTimer("UpdateClock",1000,true);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TDEditor_TD[0] = TextDrawCreate(533.999938, 2.586616, "Day");
- TextDrawLetterSize(TDEditor_TD[0], 0.342400, 1.495466);
- TextDrawAlignment(TDEditor_TD[0], 1);
- TextDrawColor(TDEditor_TD[0], 16777215);
- TextDrawSetShadow(TDEditor_TD[0], 0);
- TextDrawSetOutline(TDEditor_TD[0], 1);
- TextDrawBackgroundColor(TDEditor_TD[0], 255);
- TextDrawFont(TDEditor_TD[0], 2);
- TextDrawSetProportional(TDEditor_TD[0], 1);
- TDEditor_TD[1] = TextDrawCreate(546.000122, 19.759992, "00:00");
- TextDrawLetterSize(TDEditor_TD[1], 0.550398, 2.146236);
- TextDrawAlignment(TDEditor_TD[1], 1);
- TextDrawColor(TDEditor_TD[1], 16777215);
- TextDrawSetShadow(TDEditor_TD[1], 2);
- TextDrawSetOutline(TDEditor_TD[1], 2);
- TextDrawBackgroundColor(TDEditor_TD[1], 255);
- TextDrawFont(TDEditor_TD[1], 3);
- TextDrawSetProportional(TDEditor_TD[1], 1);
- TextDrawShowForPlayer(playerid, TDEditor_TD[0]), TextDrawShowForPlayer(playerid, TDEditor_TD[1]);
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- TextDrawHideForPlayer(playerid, TDEditor_TD[0]), TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
- return 1;
- }
- stock GetMonth(Month)
- {
- new MonthStr[15];
- switch(Month)
- {
- case 1: MonthStr = "January";
- case 2: MonthStr = "February";
- case 3: MonthStr = "March";
- case 4: MonthStr = "April";
- case 5: MonthStr = "May";
- case 6: MonthStr = "June";
- case 7: MonthStr = "July";
- case 8: MonthStr = "August";
- case 9: MonthStr = "September";
- case 10: MonthStr = "October";
- case 11: MonthStr = "November";
- case 12: MonthStr = "December";
- }
- return MonthStr;
- }
- public UpdateClock(playerid)
- {
- new string[256], day, year, month, hours, minutes;
- getdate(year, month, day), gettime(hours, minutes);
- format(string, sizeof string, "%s", GetMonth(month));
- TextDrawSetString(TDEditor_TD[0], string);
- format(string, sizeof string, "%s%d:%s%d", (hours < 10) ? ("0") : ("") , hours, (minutes < 10) ? ("0") : (""), minutes);
- TextDrawSetString(TDEditor_TD[1], string);
- }
Add Comment
Please, Sign In to add comment