ahcat 再请你帮编译一个插件
检查有C i 权限的管理者,以彩色文字形式,每30秒左右在屏幕中间上方显示他们的游戏ID并悬停10来秒左右^_^
回复: ahcat 再请你帮编译一个插件
呵呵,这个插件我有,AMXX1.0上编译的,不过没源码了,现在非常痛恨当初把源码给删了。帮不到啦。。
回复: ahcat 再请你帮编译一个插件
晕!不要删除嘛!ahcat 版主来!两个夜猫
回复: ahcat 再请你帮编译一个插件
#include <amxmodx>#include <amxmisc>
public plugin_init() {
register_plugin("CI_display","1.0","ahcat")
set_task(30.0,"hook_minute",6895,"",0,"b",0)
}
public hook_minute(){
new g_message
format(g_message,255,"OP :")
new p_id,p_count,p_name
new op_count = 0
get_players(p_id,p_count,"g")
for(new i = 0; i<p_count; i++){
if( access(p_id,ADMIN_KICK)&&access(p_id,ADMIN_CHAT)){
op_count++
get_user_name (p_id, p_name,31)
format(g_message,255,"%s [%s] ",g_message,p_name)
}
}
format(g_message,255,"%swere online.",g_message)
if (op_count == 0)
return PLUGIN_HANDLED
set_hudmessage(255, 0, 0, 0.28, 0.18, 0, 6.0, 12.0)
show_hudmessage(0, g_message)
return PLUGIN_HANDLED
}
我没有足够的人测试,你测试,有什么问题反馈一下。
回复: ahcat 再请你帮编译一个插件
好的!谢谢你了!!!回复: ahcat 再请你帮编译一个插件
我用了 !怎么没有显示管理着的名字??回复: ahcat 再请你帮编译一个插件
要有C和I 权限的玩家在线回复: ahcat 再请你帮编译一个插件
我拥有所有权限但是我等了 1分钟都没有显示!!~
我相信你版主的 技术!但是 我这边是没有设置错的 !不知道什么问题!
最后强调!我是在 AMXX1.6下面 编译使用的!
呵呵!
回复: ahcat 再请你帮编译一个插件
我在1.71编译了你看看可以不,我在1.71可以使用并附上了代码,你看看。:rolleyes:
回复: ahcat 再请你帮编译一个插件
其实用这个就好了,把VIP部分去掉就OK。#include <amxmodx>
#include <amxmisc>
#define MAX_MESSAGES 10
#define X_POS -1.0
#define Y_POS 0.15
#define HOLD_TIME 12.0
new g_Values
new g_Messages
new g_MessagesNum,g_subMsgNum
new g_Current,g_subCurrent
public plugin_init() {
register_plugin("Info. Messages",AMXX_VERSION_STR,"AMXX Dev Team")
register_dictionary("imessage.txt")
register_dictionary("common.txt")
register_srvcmd("amx_imessage","setMessage")
register_cvar("amx_freq_imessage","10")
new lastinfo
get_localinfo("lastinfomsg",lastinfo,7)
g_Current = str_to_num(lastinfo)
g_subCurrent = 0
g_subMsgNum=2
set_localinfo("lastinfomsg","")
}
public infoMessage() {
if(g_Current==0) g_subCurrent=0
if (g_Current >= g_MessagesNum)
{
g_subCurrent++;
if(g_subCurrent>=g_subMsgNum){
g_Current = 0
}
//在这里我们增加一个现实在线OP的模块
new opmsg,playerslist,playerscount,i,pos,opcount
get_players(playerslist,playerscount,"c")//Skip Bot
opcount=0;
if(g_subCurrent==1){
opmsg="当前在线的OP^n================^n"
pos=strlen(opmsg)
for(i=0;i<playerscount;i++){
if(access(playerslist,ADMIN_IMMUNITY)){
new username
get_user_name(playerslist,username,32)
opcount++
pos+=format(opmsg,511-pos,"%s^n",username)
}
}
if(opcount==0) opmsg="当前没有在线的OP"
}
if(g_subCurrent==2){
opmsg="当前在线的VIP^n================^n"
pos=strlen(opmsg)
for(i=0;i<playerscount;i++){
if(access(playerslist,ADMIN_RESERVATION)&&(!access(playerslist,ADMIN_IMMUNITY))){
new username
get_user_name(playerslist,username,32)
opcount++
pos+=format(opmsg,511-pos,"%s^n",username)
}
}
if(opcount==0) {
opmsg="当前没有在线的VIP"//We Do not display NO VIP
set_task(0.1,"infoMessage",12345)
return
}
}
set_hudmessage(0,100,255,X_POS,Y_POS,0,0.5,HOLD_TIME,2.0,2.0,1)
show_hudmessage(0,opmsg)
new Float:freq_im = get_cvar_float("amx_freq_imessage")
if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
}
else {
set_hudmessage(g_Values, g_Values, g_Values,
X_POS, Y_POS, 0, 0.5, HOLD_TIME , 2.0, 2.0, 1)
show_hudmessage(0,g_Messages)
client_print(0,print_console,g_Messages)
++g_Current
new Float:freq_im = get_cvar_float("amx_freq_imessage")
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,380)
new hostname
get_cvar_string("hostname",hostname,63)
replace(g_Messages,380,"%hostname%",hostname)
while(replace(g_Messages,380,"\n","^n")){}
new mycol
read_argv(2,mycol,11) // RRRGGGBBB
g_Values = str_to_num(mycol)
mycol = 0
g_Values = str_to_num(mycol)
mycol = 0
g_Values = str_to_num(mycol)
g_MessagesNum++
new Float:freq_im = get_cvar_float("amx_freq_imessage")
if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
return PLUGIN_HANDLED
}
public plugin_end() {
new lastinfo
num_to_str(g_Current,lastinfo,7)
set_localinfo("lastinfomsg",lastinfo)
}