[FilterScript] Wrist Watch [Textdraws]
#1


Introduction
Well, Hello Once Again. Today, I'll be releasing a Wrist Watch, that works on Textdraws. It shows Hour, Minute, Second as well as 'Day' of the week. Let's move on, shall we?

Commands

/watch - Easy, no?
Just type that, and you'll see the watch. With a timer, it'll Disappear in Five Seconds.

Screenshots
On Typing the command

Downloads

[SIZE="4"][B]Pastebin : http://pastebin.com/BAAnjHVe

Код:
//------------------------------------------
// Watch System
// By JonathanW
//------------------------------------------
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

new Text:Watch[10];

public OnFilterScriptInit()
{
	Watch[0] = TextDrawCreate(487.000000, 214.937500, "LD_POOL:ball");
	TextDrawLetterSize(Watch[0], 0.000000, 0.000000);
	TextDrawTextSize(Watch[0], 64.000000, 52.812500);
	TextDrawAlignment(Watch[0], 1);
	TextDrawColor(Watch[0], -1061109505);
	TextDrawSetShadow(Watch[0], 0);
	TextDrawSetOutline(Watch[0], 0);
	TextDrawBackgroundColor(Watch[0], 255);
	TextDrawFont(Watch[0], 4);
	TextDrawSetProportional(Watch[0], 1);
	TextDrawSetShadow(Watch[0], 0);

	Watch[1] = TextDrawCreate(501.500000, 143.187500, "LD_SPAC:white");
	TextDrawLetterSize(Watch[1], 0.000000, 0.000000);
	TextDrawTextSize(Watch[1], 33.500000, 79.500000);
	TextDrawAlignment(Watch[1], 1);
	TextDrawColor(Watch[1], -1061109505);
	TextDrawSetShadow(Watch[1], 0);
	TextDrawSetOutline(Watch[1], 0);
	TextDrawBackgroundColor(Watch[1], 255);
	TextDrawFont(Watch[1], 4);
	TextDrawSetProportional(Watch[1], 1);
	TextDrawSetShadow(Watch[1], 0);

	Watch[2] = TextDrawCreate(503.000000, 262.187500, "LD_SPAC:white");
	TextDrawLetterSize(Watch[2], 0.000000, 0.000000);
	TextDrawTextSize(Watch[2], 33.500000, 79.500000);
	TextDrawAlignment(Watch[2], 1);
	TextDrawColor(Watch[2], -1061109505);
	TextDrawSetShadow(Watch[2], 0);
	TextDrawSetOutline(Watch[2], 0);
	TextDrawBackgroundColor(Watch[2], 255);
	TextDrawFont(Watch[2], 4);
	TextDrawSetProportional(Watch[2], 1);
	TextDrawSetShadow(Watch[2], 0);

	Watch[3] = TextDrawCreate(492.000000, 219.750000, "LD_POOL:ball");
	TextDrawLetterSize(Watch[3], 0.000000, 0.000000);
	TextDrawTextSize(Watch[3], 54.000000, 42.312500);
	TextDrawAlignment(Watch[3], 1);
	TextDrawColor(Watch[3], -1523963137);
	TextDrawSetShadow(Watch[3], 0);
	TextDrawSetOutline(Watch[3], 0);
	TextDrawBackgroundColor(Watch[3], 255);
	TextDrawFont(Watch[3], 4);
	TextDrawSetProportional(Watch[3], 1);
	TextDrawSetShadow(Watch[3], 0);

	Watch[4] = TextDrawCreate(505.500000, 227.625000, "12:12");
	TextDrawLetterSize(Watch[4], 0.264999, 1.201875);
	TextDrawAlignment(Watch[4], 1);
	TextDrawColor(Watch[4], -1);
	TextDrawSetShadow(Watch[4], 0);
	TextDrawSetOutline(Watch[4], 0);
	TextDrawBackgroundColor(Watch[4], 255);
	TextDrawFont(Watch[4], 2);
	TextDrawSetProportional(Watch[4], 1);
	TextDrawSetShadow(Watch[4], 0);

	Watch[5] = TextDrawCreate(516.000000, 156.750000, ".~n~.~n~.");
	TextDrawLetterSize(Watch[5], 0.400000, 1.600000);
	TextDrawAlignment(Watch[5], 1);
	TextDrawColor(Watch[5], -2139062017);
	TextDrawSetShadow(Watch[5], 0);
	TextDrawSetOutline(Watch[5], 0);
	TextDrawBackgroundColor(Watch[5], 255);
	TextDrawFont(Watch[5], 1);
	TextDrawSetProportional(Watch[5], 1);
	TextDrawSetShadow(Watch[5], 0);

	Watch[6] = TextDrawCreate(504.500000, 137.500000, "-----");
	TextDrawLetterSize(Watch[6], 0.400000, 1.600000);
	TextDrawAlignment(Watch[6], 1);
	TextDrawColor(Watch[6], -2139062017);
	TextDrawSetShadow(Watch[6], 0);
	TextDrawSetOutline(Watch[6], 0);
	TextDrawBackgroundColor(Watch[6], 255);
	TextDrawFont(Watch[6], 1);
	TextDrawSetProportional(Watch[6], 1);
	TextDrawSetShadow(Watch[6], 0);

	Watch[7] = TextDrawCreate(505.000000, 329.125000, "-----");
	TextDrawLetterSize(Watch[7], 0.400000, 1.600000);
	TextDrawAlignment(Watch[7], 1);
	TextDrawColor(Watch[7], -2139062017);
	TextDrawSetShadow(Watch[7], 0);
	TextDrawSetOutline(Watch[7], 0);
	TextDrawBackgroundColor(Watch[7], 255);
	TextDrawFont(Watch[7], 1);
	TextDrawSetProportional(Watch[7], 1);
	TextDrawSetShadow(Watch[7], 0);

	Watch[8] = TextDrawCreate(509.500000, 250.375000, "");
	TextDrawLetterSize(Watch[8], 0.217500, 0.821249);
	TextDrawAlignment(Watch[8], 1);
	TextDrawColor(Watch[8], -1);
	TextDrawSetShadow(Watch[8], 0);
	TextDrawSetOutline(Watch[8], 0);
	TextDrawBackgroundColor(Watch[8], 255);
	TextDrawFont(Watch[8], 2);
	TextDrawSetProportional(Watch[8], 1);
	TextDrawSetShadow(Watch[8], 0);

	Watch[9] = TextDrawCreate(510.000000, 236.375000, "54");
	TextDrawLetterSize(Watch[9], 0.339000, 1.363750);
	TextDrawAlignment(Watch[9], 1);
	TextDrawColor(Watch[9], -1);
	TextDrawSetShadow(Watch[9], 0);
	TextDrawSetOutline(Watch[9], 0);
	TextDrawBackgroundColor(Watch[9], 255);
	TextDrawFont(Watch[9], 2);
	TextDrawSetProportional(Watch[9], 1);
	TextDrawSetShadow(Watch[9], 0);
	
	
	print("\n----------------------------------------");
	print("-- Wrist Watch - Created by JonathanW --");
	print("----------------------------------------\n");
	
	SetTimer("SetWatchTime",1000,true);
	return 1;
}
stock GetWeekDay(day=0, month=0, year=0) // Credits to Yom
{
  if (!day)
    getdate(year, month, day);

  new
    weekday_str[10],
    j,
    e
  ;

  if (month <= 2)
  {
    month += 12;
    --year;
  }

  j = year % 100;
  e = year / 100;

  switch ((day + (month+1)*26/10 + j + j/4 + e/4 - 2*e) % 7)
  {
    case 0: weekday_str = "SAT";
    case 1: weekday_str = "SUN";
    case 2: weekday_str = "MON";
    case 3: weekday_str = "TUE";
    case 4: weekday_str = "WED";
    case 5: weekday_str = "THU";
    case 6: weekday_str = "FRI";
  }

  return weekday_str;
}
stock ShowWatch(playerid)
{
	TextDrawShowForPlayer(playerid, Watch[0]);
	TextDrawShowForPlayer(playerid, Watch[1]);
	TextDrawShowForPlayer(playerid, Watch[2]);
	TextDrawShowForPlayer(playerid, Watch[3]);
	TextDrawShowForPlayer(playerid, Watch[4]);
	TextDrawShowForPlayer(playerid, Watch[5]);
	TextDrawShowForPlayer(playerid, Watch[6]);
	TextDrawShowForPlayer(playerid, Watch[7]);
	TextDrawShowForPlayer(playerid, Watch[8]);
	TextDrawShowForPlayer(playerid, Watch[9]);
	return 1;
}
stock HideWatch(playerid)
{
	TextDrawHideForPlayer(playerid, Watch[0]);
	TextDrawHideForPlayer(playerid, Watch[1]);
	TextDrawHideForPlayer(playerid, Watch[2]);
	TextDrawHideForPlayer(playerid, Watch[3]);
	TextDrawHideForPlayer(playerid, Watch[4]);
	TextDrawHideForPlayer(playerid, Watch[5]);
	TextDrawHideForPlayer(playerid, Watch[6]);
	TextDrawHideForPlayer(playerid, Watch[7]);
	TextDrawHideForPlayer(playerid, Watch[8]);
	TextDrawHideForPlayer(playerid, Watch[9]);
	return 1;
}
public OnFilterScriptExit()
{
	return 1;
}

CMD:watch(playerid,params[])
{
	ShowWatch(playerid);
	SetTimerEx("WatchHide", 5000, 0, "i", playerid);
	return 1;
}

//Watch System
forward SetWatchTime();
public SetWatchTime()
{
	new string[256];
 	new Year,Month,Day;	getdate(Year, Month, Day);
	new Hour,Min,Sec; gettime(Hour,Min,Sec);
 	format(string, sizeof string, "%s", GetWeekDay(Day, Month, Year));
 	TextDrawSetString(Watch[8], string);
 	format(string, sizeof string, "%s%d:%s%d", (Hour < 10) ? ("0") : (""), Hour, (Min < 10) ? ("0") : (""), Min);
 	TextDrawSetString(Watch[4], string);
 	format(string, sizeof string, "%s%d",(Sec < 10) ? ("0") : (""), Sec);
 	TextDrawSetString(Watch[9], string);
	return 1;
}

forward WatchHide(playerid);
public WatchHide(playerid)
{

    HideWatch(playerid);
	return 1;
}
Leave your Comments,
Reply
#2

Interesting gj
Reply
#3

Looks cool! Nice feature.
Reply
#4

good but u removed pastebin
Reply
#5

Good job

btw,
Quote:

Leave your Commands,

lmfao.
Reply
#6

Quote:
Originally Posted by Crowler
Посмотреть сообщение
Good job

btw, lmfao.
XD.
P.S I didn't remove the pastebin did I?
Reply
#7

Unique, good work. +3.
Reply
#8

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
Unique, good work. +3.
+3, Wow thanks!
Reply
#9

nice job.
Reply
#10

Quote:
Originally Posted by JonathanW
Посмотреть сообщение
XD.
P.S I didn't remove the pastebin did I?
Yes, you removed '-'
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)