
/* AMX Mod script.
*
* (c) Copyright 2002, OLO
* This file is provided as is (no warranties).
*
*/

#include <amxmod>

#define TIME_HOURS_OFFSET 0

new last_announce = -1

public announcetime()
{
	new stime[4]
	get_time("%M",stime,3)
	new minutes = strtonum(stime)
	
	if (last_announce != minutes && (minutes == 0 || 
			minutes == 15 || minutes == 30 || minutes == 45) )
	{	
		last_announce = minutes
		
		get_time("%H",stime,3)
		new hours  = strtonum(stime)
		
		if ((hours += TIME_HOURS_OFFSET) < 0) 
			hours = 23
		
		client_print(0,print_notify,"* Time on server: %02d:%02d",hours,minutes)
		
		set_hudmessage(255, 100, 0, -1.0, 0.30, 0, 0.5, 6.0 , 2.0, 2.0, 1)
		show_hudmessage(0,"Time on server: %02d:%02d",hours,minutes)
	}
	
	return PLUGIN_CONTINUE
}

public plugin_init()
{
  register_plugin("Announce Time", "1.0", "OLO")
	set_task(50.0,"announcetime",123,"",0,"b")
	return PLUGIN_CONTINUE
}

