|
发表于 2005-11-20 01:45:11
|
显示全部楼层
|阅读模式
来自 中国–广东–深圳
我做了个简单的修改,但是有管理员在线的时候就会显示“目前在线管理XXX”然后接着全部显示VIP用户;管理员不时在就显示全部VIP用户。
谁能告诉我去掉哪部分就不会显示VIP用户吗? :dribble:
附上我改动过的源码:
- #include <amxmodx>
- #include <amxmisc>
- #define MAX_MESSAGES 6
- #define X_POS -1.0
- #define Y_POS -3.0
- #define HOLD_TIME 8.0
- #define RANDOM_COL
- new g_Values[MAX_MESSAGES][3]
- new g_Messages[MAX_MESSAGES][384]
- new g_MessagesNum
- new g_Current
- new g_players[32]
- new num
- public plugin_init() {
- register_plugin("Info. Messages",AMXX_VERSION_STR,"AMXX Dev Team")
- register_dictionary("imessage.txt")
- register_dictionary("common.txt")
- register_srvcmd("amx_adminonline","setMessage")
- register_cvar("amx_freq_adminonline","10")
- new lastinfo[8]
- get_localinfo("lastinfomsg",lastinfo,7)
- g_Current = str_to_num(lastinfo)
- set_localinfo("lastinfomsg","")
- }
- public infoMessage() {
- new admin[128],vip[128],temp[768]
- new ad_vip[32],p_num,ad_num,v_num,name[32]
- new apos = 0
- new vpos = 0
- if (g_Current >= g_MessagesNum)
- g_Current = 0
- get_players(ad_vip,p_num,"c")
- apos += format(admin[apos],127-apos,"【当前在线管理员】^n__________________________________________^n")
- for (new i=0; i<p_num; i++) {
- if(access(ad_vip[i],ADMIN_IMMUNITY)){
- ad_num++
- get_user_name(ad_vip[i],name,31)
- apos += format(admin[apos],127-apos,"%s ",name)
- }
- if(access(ad_vip[i],ADMIN_RESERVATION) && !access(ad_vip[i],ADMIN_IMMUNITY)){
- v_num++
- get_user_name(ad_vip[i],name,31)
- vpos += format(vip[vpos],127-vpos,"%s ",name)
- }
- }
- if (ad_num == 0)
- format(admin,127,"【欢迎来到XXX1.6服务器】^n__________________________________________^n目前没有OP在线")
- format(temp,767,"%s^n%s%s",g_Messages[g_Current],admin,vip)
- #if defined RANDOM_COL
- set_hudmessage(random_num(25,100), random_num(25,100), random_num(25,1000),
- X_POS, Y_POS, 2, 0.5, HOLD_TIME , 2.0, 2.0, 1)
- #else
- set_hudmessage(g_Values[g_Current][0], g_Values[g_Current][1], g_Values[g_Current][2],
- X_POS, Y_POS, 2, 0.5, HOLD_TIME , 2.0, 2.0, 1)
- #endif
- get_players(g_players,num,"bc")
- for (new i=0; i<num; i++){
- show_hudmessage(g_players[i],temp)
- client_print(g_players[i],print_console,temp)
- }
- ++g_Current
- new Float:freq_im = get_cvar_float("amx_freq_adminonline")
- if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
- }
- public setMessage() {
- if (g_MessagesNum >= MAX_MESSAGES) {
- server_print("%L",LANG_SERVER,"INF_REACH")
- return PLUGIN_HANDLED
- }
- remove_task(12345)
- read_argv(1,g_Messages[g_MessagesNum],380)
- new hostname[64]
- get_cvar_string("hostname",hostname,63)
- replace(g_Messages[g_MessagesNum],380,"%hostname%",hostname)
- while(replace(g_Messages[g_MessagesNum],380,"\n","^n")){}
- new mycol[12]
- read_argv(2,mycol,11) // RRRGGGBBB
- g_Values[g_MessagesNum][2] = str_to_num(mycol[6])
- mycol[6] = 0
- g_Values[g_MessagesNum][1] = str_to_num(mycol[3])
- mycol[3] = 0
- g_Values[g_MessagesNum][0] = str_to_num(mycol[0])
- g_MessagesNum++
- new Float:freq_im = get_cvar_float("amx_freq_adminonline")
- if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
- return PLUGIN_HANDLED
- }
- public plugin_end() {
- new lastinfo[8]
- num_to_str(g_Current,lastinfo,7)
- set_localinfo("lastinfomsg",lastinfo)
- }
复制代码
麻烦各位了~~~ |
|