All pastes #1403767 Raw Edit

Shadow

public text v1 · immutable
#1403767 ·published 2009-04-26 20:31 UTC
rendered paste body
#include <a_samp>
#define FILTERSCRIPT

new Text:Time;
new Text:Date;

forward settime(playerid);

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Updated Version! WORLDCLOCK+DATE By Shadow");
	print("--------------------------------------\n");

	Date = TextDrawCreate(547.000000,25.000000,"--");
	Time = TextDrawCreate(547.000000,39.000000,"--");
	TextDrawAlignment(Date,0);
	TextDrawAlignment(Time,0);
	TextDrawBackgroundColor(Date,0x000000ff);
	TextDrawBackgroundColor(Time,0x000000ff);
	TextDrawFont(Date,3);
	TextDrawLetterSize(Date,0.399999,1.500000);
	TextDrawFont(Time,3);
	TextDrawLetterSize(Time,0.399999,1.500000);
	TextDrawColor(Date,0xffffffff);
	TextDrawColor(Time,0xffffffff);
	TextDrawSetOutline(Date,1);
	TextDrawSetOutline(Time,1);
	TextDrawSetProportional(Date,1);
	TextDrawSetProportional(Time,1);
	TextDrawSetShadow(Date,1);
	TextDrawSetShadow(Time,1);

	SetTimer("settime",1000,true);
	return 1;
}

public OnFilterScriptExit()
{
	print("\n-----------------------------------------------------");
	print(" Update Version! WORLDCLOCK+DATE By Shadow !UNLOADED!");
	print("-----------------------------------------------------/n");
	return 1;
}

public OnPlayerSpawn(playerid)
{
	SendClientMessage(playerid, 0xF97804FF, "This server is running Shadows Worldclock+Date AddOn!");
	TextDrawShowForPlayer(playerid, Time);
	TextDrawShowForPlayer(playerid, Date);
	
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	TextDrawHideForPlayer(playerid, Time);
	TextDrawHideForPlayer(playerid, Date);
	return 1;
}

public settime(playerid)
{
	new string[256],year,month,day,hours,minutes,seconds;
	getdate(year, month, day);
	gettime(hours, minutes, seconds);
	format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
	TextDrawSetString(Date, string);
	format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
	TextDrawSetString(Time, string);
}