hackroad 发表于 2009-6-4 05:54:14

显示当前OP



Description:
This Plugin Shows How Many Admins Are Online And Their Names
Via Hud Msg.
The Position Of Hud Msg Can Be Changed Via Cvars Also
The Colors Can Be Changed For Online Msg And Offline Msg.


Cvars:
sa_plugin_on "1" -> Turn Admin Show On/Off
sa_online_color "0 130 0" -> When Admin Online Is Default Color Green
sa_offline_color "255 0 0" -> When No Admin On Server Default Color Red
sa_msg_xypos "0.02 0.2" -> Hud Msg Position Currently On Left Side

If You Want To Have The Hud Msg On Right Side Set Cvar sa_msg_xypos "0.8 0.2"

ypf 发表于 2009-6-8 12:53:13

???????????????????????????

only33 发表于 2009-6-8 12:56:05

。。。论坛里很多了。

LittleKu 发表于 2009-6-9 13:24:24

这个还要点通币,LZ你也太@#¥了吧!!#include <amxmodx>
#include <engine>

#define PLUGIN"Show Admins Online"
#define VERSION "1.1"
#define AUTHOR"vato loco & Alka"

new bool:g_bAdminNick
new bool:is_admin_connected
new g_msg

new g_admin_enable
new g_online_color
new g_offline_color
new g_msg_xypos

new g_SyncAdmin
new g_iAdminCount
new g_iMaxPlayers

new g_ClassName[] = "admin_msg"

public plugin_init()
{
        register_plugin( PLUGIN, VERSION, AUTHOR )
       
        register_think(g_ClassName,"ForwardThink")
       
        g_admin_enable = register_cvar("sa_plugin_on","1")
        g_online_color = register_cvar("sa_online_color","0 130 0")
        g_offline_color = register_cvar("sa_offline_color","255 0 0")
        g_msg_xypos = register_cvar("sa_msg_xypos","0.02 0.2")
       
        g_SyncAdmin = CreateHudSyncObj()
        g_iMaxPlayers = get_maxplayers()
       
        new iEnt = create_entity("info_target")
        entity_set_string(iEnt, EV_SZ_classname, g_ClassName)
        entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public client_putinserver(id)
{
        if(get_user_flags(id) & ADMIN_KICK)
        {
                is_admin_connected = true
                g_iAdminCount++
                set_admin_msg()
        }
        if(g_iAdminCount == 0)
                set_admin_msg()
}

public client_disconnect(id)
{
        if(is_admin_connected)
        {
                is_admin_connected = false
                g_iAdminCount--
                set_admin_msg()
        }
}

public client_infochanged(id)
{
        if(is_admin_connected)
        {
                static NewName, OldName
                get_user_info(id, "name", NewName, 31)
                get_user_name(id, OldName, 31)
               
                if(!equal(OldName, NewName))
                {
                        g_bAdminNick = true
                }
        }
}

public set_admin_msg()
{
        static g_iAdminName, pos, i
        pos = 0
        pos += formatex(g_msg, 511-pos, "Admins Online: %d", g_iAdminCount)
       
        for(i = 1 ; i <= g_iMaxPlayers ; i++)
        {       
                if(is_admin_connected)
                {
                        get_user_name(i, g_iAdminName, 31)
                        pos += formatex(g_msg, 511-pos, "^n%s", g_iAdminName)
                }
        }
}

public admins_online()
{
        if(get_pcvar_num(g_admin_enable))
        {
                static r, g, b, Float:x,Float:y
                HudMsgPos(x,y)
               
                if (g_iAdminCount > 0)
                {
                        HudMsgColor(g_online_color, r, g, b)
                        set_hudmessage(r, g, b, x, y, _, _, 4.0, _, _, 4)
                        ShowSyncHudMsg(0, g_SyncAdmin, "%s", g_msg)
                }
                else
                {
                        HudMsgColor(g_offline_color, r, g, b)
                        set_hudmessage(r, g, b, x, y, _, _, 4.0, _, _, 4)
                        ShowSyncHudMsg(0, g_SyncAdmin, "%s", g_msg)
                }
        }
        return PLUGIN_HANDLED
}

public ForwardThink(iEnt)
{
        admins_online()
       
        if(g_bAdminNick)
        {
                set_admin_msg()
                g_bAdminNick = false
        }
      entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public HudMsgColor(cvar, &r, &g, &b)
{
        static color, piece
        get_pcvar_string(cvar, color, 15)
       
        strbreak( color, piece, 4, color, 15)
        r = str_to_num(piece)
       
        strbreak( color, piece, 4, color, 15)
        g = str_to_num(piece)
        b = str_to_num(color)
}

public HudMsgPos(&Float:x, &Float:y)
{
        static coords, piece
        get_pcvar_string(g_msg_xypos, coords, 15)
       
        strbreak(coords, piece, 9, coords, 15)
        x = str_to_float(piece)
        y = str_to_float(coords)
}

hackroad 发表于 2009-6-10 07:52:57

这个还要点通币,LZ你也太@#¥了吧!!#include
#include

#define PLUGIN"Show Admins Online"
#define VERSION "1.1"
#define AUTHOR"vato loco & Alka"

new bool:g_bAdminNick
new bool:is_adm ...
kk阿朗 发表于 2009-6-9 13:24 http://www.dt-club.net/forum/images/common/back.gif
学别人哈哈

jackemoney 发表于 2009-8-21 12:32:14

晕........这个插件还收.

66781881 发表于 2009-8-23 01:35:54

顶你```````
页: [1]
查看完整版本: 显示当前OP