|
发表于 2006-8-30 03:26:17
|
显示全部楼层
来自 中国–广东–深圳
回复: 【集中贴】提出你们想要的插件.
我想把这个插件再完善一些,我先把代码改为我要那种效果.你看看可以吗.
1.我想问问,如果管理员有2-10个同时在线,显示的管理员ID会自动换行吗?
2.可以设置为在amxx.cfg里调显示的时长吗//也就是隔多久显示一次.麻烦你了.谢谢!
3.代码里的效果是我想要的,能不能那样改.
- #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[256]
- format(g_message,255,"当前管理员^n__________________________^n")
-
- new p_id[32],p_count,p_name[32]
- new op_count = 0
-
- get_players(p_id,p_count,"g")
-
- for(new i = 0; i<p_count; i++){
- if( access(p_id[i],ADMIN_KICK)&&access(p_id[i],ADMIN_BAN)){
- op_count++
- get_user_name (p_id[i], 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)//这里添加format(g_message,255,"暂无OP在线",g_message)
- 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
- }
复制代码 |
|