|
发表于 2013-3-29 21:15:04
|
显示全部楼层
来自 中国–甘肃–天水
本帖最后由 我是新手 于 2013-3-29 21:17 编辑
99fps 发表于 2013-3-19 00:01
有源码吗?
比你那个显示的更全面,自己汉化下吧。
万幸找到了,差点放弃...
- /* This plugin is made by xakintosh with Amxmodx Studio 1.4.3 (final) */
- // Thanks to @He3aBucuM
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- new hud_rgb, hud_x, hud_y, hud_effects,maxplayers,hudsync, curr_uptime[22], g_round = 1;
- public plugin_init() {
- register_plugin("Server Side Info","1.6","xakintosh")
- hud_rgb = register_cvar( "srv_hud_rgb", "0 255 0" )
- hud_x = register_cvar( "srv_hud_x", "0.11" )
- hud_y = register_cvar( "srv_hud_y", "0.00" )
- hud_effects = register_cvar( "srv_hud_effects", "0" )
- hudsync = CreateHudSyncObj()
- maxplayers = get_maxplayers()
- set_task(0.1, "Fwd_StartFrame", 1, "", 0, "b")
- set_task(0.1, "check_uptime", _, _, _, "b")
- register_forward(FM_StartFrame, "Fwd_StartFrame")
- register_event("HLTV", "event_newround", "a", "1=0", "2=0");
- }
- public event_newround() {
- g_round++
- }
- public Fwd_StartFrame(id) {
- new timestring[31]
- get_time("%H:%M:%S",timestring,8)
- static Float:GameTime, Float:FramesPer = 0.0
- static Float:Fps
- GameTime = get_gametime()
- if(FramesPer >= GameTime)
- Fps += 1.0;
- else {
- FramesPer = FramesPer + 1.0
- for( new id = 1; id <= maxplayers; id++ ) {
- new ip[42],red, green, blue
- new const admins = GetTotalAdmins()
- new timeleft = get_timeleft()
- get_hud_color(red, green, blue)
- get_user_ip(0, ip, 31, 1)
- set_hudmessage(red,green,blue,get_pcvar_float(hud_x),get_pcvar_float(hud_y),get_pcvar_num(hud_effects),6.0,1.0)
- ShowSyncHudMsg(id,hudsync,"|* --------------------* Information *-------------------- *|^n|* Timeleft: %d:%02d | Thetime: %s^n|* Server FPS: %.1f | Server IP: %s^n|* Server Uptime: %s^n|* Frags: %i | Deaths: %i | Admins: %i | Round: %d",timeleft / 60, timeleft % 60,timestring,Fps,ip,curr_uptime,get_user_frags(id),get_user_deaths(id),admins,g_round)
- }
- Fps = 0.0
- }
- }
- get_hud_color(&r, &g, &b) {
- new color[20]
- static red[5], green[5], blue[5]
- get_pcvar_string(hud_rgb, color, charsmax(color))
- parse(color, red, charsmax(red), green, charsmax(green), blue, charsmax(blue))
- r = str_to_num(red)
- g = str_to_num(green)
- b = str_to_num(blue)
- }
- static GetTotalAdmins() {
- new iPlayers[32],iNum,Admins
- get_players(iPlayers,iNum)
- for(new Count;Count < iNum;Count++)
- if(is_user_admin(iPlayers[Count]))
- Admins++
- return Admins
- }
- public check_uptime() {
- new Float:ft = Float:engfunc(EngFunc_Time)
- new it = floatround(ft)
- new m = (it / 60) % 60
- new h = (it / 3600) % 24
- new d = it / 86400
- format(curr_uptime, 21, "%id:%ih:%im", d, h, m)
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|