/* 
*  AMX X Mod script. 
* 
* (c) Copyright 2007, Sif0n
* This file is provided as is (no warranties). 
*/ 


/* 
* ShowTime displays the time and timeleft nextmap on the top-center of the client 
* display as a hudmessage. 
* 
* History: 
* v1.0: - first release 
*/ 


#include <amxmodx> 


public show_time(){ 

    static hostname[64];   
    new ctime[64]
    new timeleft_minutes
    new timeleft_seconds
    new nextmap[31]
    get_time("%H:%M:%S", ctime, 63)
    timeleft_minutes = get_timeleft()/60
    timeleft_seconds = get_timeleft()%60

    get_cvar_string("hostname", hostname, sizeof hostname -1)
    get_cvar_string("amx_nextmap",nextmap,31)

    set_hudmessage(0,255,0,0.8,0.01,0, 1.0, 1.0, 0.1, 0.2, 13) 
    show_hudmessage(0,"%s^nвремя: %s^nдо следущей карты: %i:%i^n", hostname, ctime, timeleft_minutes, timeleft_seconds) 
    return PLUGIN_CONTINUE   
} 

public plugin_init() 
{ 
    register_plugin("ShowTime","1.0","Sif0n") 
    set_task(1.0, "show_time",0,"",0,"b") 
    return PLUGIN_CONTINUE 
} 