|
发表于 2014-12-9 08:41:32
|
显示全部楼层
|阅读模式
来自 中国–安徽–六安–舒城县
[mw_shl_code=pawn,true]#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <engine>
#include <cstrike>
#define PLUGIN "Show Time"
#define VERSION "1.0"
#define AUTHOR "YJ Dev Team:Jakyo"
new g_MapName[32]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
get_mapname(g_MapName, sizeof(g_MapName)-1)
}
public client_putinserver(id)
{
set_task(1.0, "showtime", id + 7890)
}
public showtime(taskid)
{
new id = taskid - 7890
new msg[512], serverip[32]
if (is_user_connected(id))
{
new year,month,day,hour, minute, second
date(year, month, day)
time(hour, minute, second)
get_user_ip(0, serverip, 16, 0)
new mapname[32]
get_cvar_string("amx_nextmap",mapname,31)
new a = get_timeleft()
format(msg, 511, "%sIP:%s", msg, serverip)
format(msg, 511, "%s^nQun Hao: 789456 456789", msg)
new bossid = get_flags_user()
if (bossid)
{
new name[33]
get_user_name(bossid, name ,32)
format(msg, 511, "%s^nBOSS: %s", msg, name)
}
else
format(msg, 511, "%s^nBOSS: Mei You Boss Zai Xian", msg)
format(msg, 511, "%s^n---------------------------", msg)
format(msg, 511, "%s^n%d-%d-%d- %d:%d:%d", msg, year, month, day ,hour, minute, second)
format(msg, 511, "%s^nThis Map:%s", msg, g_MapName)
format(msg, 511, "%s^nNext Map:%s", msg, mapname)
format(msg, 511, "%s^nTime Left:%d:%d", msg, a / 60, a % 60)
// format(msg, 511, "%s^nServer FPS:%s", msg, mapname)
format(msg, 511, "%s^n---------------------------", msg)
set_hudmessage(255, 255, 150, 0.8, 0.3, 0, 0.0, 1.0, 0.1, 0.1, 3)
show_hudmessage(id, "%s", msg)
set_task(1.0, "showtime", id + 7890)
}
}
public get_flags_user()
{
for (new id=1; id<=32; id++)
{
if (is_user_connected(id) && get_user_flags(id))
{
return id
}
}
return 0
}[/mw_shl_code] |
|