Код за потвърждение: Избери целия код
/********************************************************
Show me the time plugin V1.2
by flintst0nes http://flintst0nes.de.vu
for flintst0nes FUNSERVER FAST DL
visit steam CS1.6 @ 85.131.217.14:27025
**********************************************************
This plugin for AMX Mod X displays the current
server time, the time remaining on map and
the next map coming up under the radar.
Just install the plugin the usual way copying the
amxx-file to addons/amxmodx/plugins and append
showmethetime.amxx to your plugins.ini
**********************************************************
CHANGELOG
V1.25
- added cutom msg support
V1.2
- added cvar to disable display
- added cvars for custom positioning
- added cvars for custom color
V1.1
- added cvar to hide nextmap and timeleft info
V1.0
- shows thetime, timeleft and nextmap
**********************************************************
Cvars:
amx_smtt_showinfo 0|1 default: 1
toggles plugin activity (0 = off)
amx_moreinfo 0|1 default: 1
toggles timeleft and nextmap info (0 = off)
amx_smtt_xpos 0.0 to 1.0 (floating point)
set x position (upper left corner), default: 0.015
amx_smtt_ypos 0 to 1 (floating point)
set y position (upper left corner), default: 0.35
amx_smtt_red 0 to 255 (integer)
set display color red part, default: 0
amx_smtt_green 0 to 255 (integer)
set display color green part, default: 255
amx_smtt_blue 0 to 255 (integer)
set display color blue part, default: 0
amx_smtt_custommsg "my custom string"
displays a custom string, leave empty to disable, max 32 characters
**********************************************************/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init() {
register_plugin("Show me the time","1.2","flintst0nes.de.vu")
set_task(1.0,"Tick",0,_,_,"b")
register_cvar("amx_smtt_showinfo","1",0)
register_cvar("amx_smtt_moreinfo","1",0)
register_cvar("amx_smtt_xpos","0.015",0)
register_cvar("amx_smtt_ypos","0.35",0)
register_cvar("amx_smtt_red","0",0)
register_cvar("amx_smtt_green","255",0)
register_cvar("amx_smtt_blue","0",0)
register_cvar("amx_smtt_custommsg","flintst0nes.de.vu",0)
}
public Tick(){
if(!get_cvar_num("amx_smtt_showinfo")){
return PLUGIN_HANDLED
}else{
new players[32],num,i
get_players(players,num)
for(i = 0; i <= num; i++)
{
new id = players[i]
new timestring[31]
new timeleft_minutes
new timeleft_seconds
new nextmap[31]
new message[256]
new custommessage[31]
if(is_user_connected(id)) {
get_time("%H:%M:%S",timestring,8)
get_cvar_string("amx_smtt_custommsg", custommessage, 31)
if(get_cvar_num("amx_smtt_moreinfo")){
timeleft_minutes = get_timeleft()/60
timeleft_seconds = get_timeleft()%60
get_cvar_string("amx_nextmap",nextmap,31)
if( strcmp(custommessage, "",0) == 0 ){
format(message,255,"Thetime: %s^nTimeleft: %i:%i^nNextmap: %s", timestring, timeleft_minutes, timeleft_seconds, nextmap)
}else{
format(message,255,"%s^nThetime: %s^nTimeleft: %i:%i^nNextmap: %s",custommessage, timestring, timeleft_minutes, timeleft_seconds, nextmap)
}
}else{
if( strcmp(custommessage, "",0) == 0 ){
format(message,255,"Thetime: %s", timestring)
}else{
format(message,255,"%s^nThetime: %s",custommessage, timestring)
}
}
set_hudmessage (get_cvar_num("amx_smtt_red"),get_cvar_num("amx_smtt_green"),get_cvar_num("amx_smtt_blue"), get_cvar_float("amx_smtt_xpos"), get_cvar_float("amx_smtt_ypos"), 0, 6.0, 2.0, 0.1, 0.2, 4 )
show_hudmessage(id, message)
}
}
}
return PLUGIN_HANDLED
}